I am looking how to bypass pass proxy using tor and torctl, I looked on various steps and wrote this script in python.
After starting tor, ideally this should work
proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:8118"} )
opener = urllib2.build_opener(proxy_support)
urllib2.install_opener(opener)
#urllib2.urlopen('http://www.google.fr')
data = json.load(urllib2.urlopen("https://www.google.co.in/trends/hottrends/hotItems?geo=IN&mob=0&hvsm=0"))
which again gives this message :
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Unavailable
I have already started tor and enabled control port using
tor --controlport 9051
after using tor as tor as a SOCKS proxy.
tor SOCKSPort 1080
python:
>>> import urllib2
>>> proxy_support = urllib2.ProxyHandler({"http" : "127.0.0.1:1080"})
>>> opener = urllib2.build_opener(proxy_support)
>>> urllib2.install_opener(opener)
>>> import json
>>> data = json.load(urllib2.urlopen("https://www.google.co.in/trends/hottrends/hotItems?geo=IN&mob=0&hvsm=0"))
which again gives same error message.
Is there any way to get rid of this?