Skip to content

Instantly share code, notes, and snippets.

@orsinium
Created May 4, 2017 18:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orsinium/541527e395b1fb5cfb694a2911db77be to your computer and use it in GitHub Desktop.
Save orsinium/541527e395b1fb5cfb694a2911db77be to your computer and use it in GitHub Desktop.
Check tor connection: ip and time.
from grab import Grab, GrabError
from time import time
g = Grab()
t = time()
g.go('ip.appspot.com')
print(time()-t)
print(g.response.body)
g.setup(reuse_cookies=False, proxy_type='socks4', connect_timeout=5, timeout=5, proxy="127.0.0.1:9050");
t = time()
g.go('ip.appspot.com')
print(time()-t)
print(g.response.body)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment