Skip to content

Instantly share code, notes, and snippets.

@ep4sh
Created November 27, 2017 09:55
Show Gist options
  • Select an option

  • Save ep4sh/c1d1bbc6fc1108232160b33f7fb62535 to your computer and use it in GitHub Desktop.

Select an option

Save ep4sh/c1d1bbc6fc1108232160b33f7fb62535 to your computer and use it in GitHub Desktop.
Python+SELENIUM+TOR
from selenium import webdriver
service_args = [ '--proxy=localhost:9150', '--proxy-type=socks5', ]
driver = webdriver.PhantomJS(executable_path='<path to PhantomJS>', service_args=service_args)
driver.get("http://icanhazip.com")
print(driver.page_source)
driver.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment