pgaref / HTTP_Request_Randomizer

Proxying Python Requests
http://pgaref.com/blog/python-proxy/
MIT License
148 stars 60 forks source link

NameError: global name 'test_url' is not defined #15

Closed asmaier closed 8 years ago

asmaier commented 8 years ago

When I do

    >>> import requestProxy
    >>> proxy = requestProxy.RequestProxy()
    >>> proxy.generate_proxied_request("http://www.google.com")

I get the error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "requestProxy.py", line 64, in generate_proxied_request
    request = requests.get(test_url, proxies={"http": rand_proxy},
NameError: global name 'test_url' is not defined

I believe in line 64 of requestProxy.py it should say "url" instead of "test_url":

https://github.com/pgaref/HTTP_Request_Randomizer/blob/master/project/http/requests/proxy/requestProxy.py#L64

pgaref commented 8 years ago

@asmaier you are totally right! test_url is a global variable that's why it was not causing a problem so far. I can see you have a fix already, want to create a pull request?

Thanks!

asmaier commented 8 years ago

I created a pull request from my fork.