Answer the question
In order to leave comments, you need to log in
Why doesn't Selenium change IP?
Why doesn't Selenium change my IP address with Tor? Although with the help of requests it changes. Here is the code I am using
tor = subprocess.Popen('C:\\Users\\sinto\\Desktop\\Tor\\Tor.exe')
time.sleep(10)
s = Service("C:\\Users\\sinto\\PycharmProjects\\AutoREG\\chromedriver.exe")
options = webdriver.ChromeOptions()
options.add_extension('C:\\Users\\sinto\\PycharmProjects\\AutoREG\\UBlocker.crx')
driver = webdriver.Chrome(service=s, options=options)
url = "http://icanhazip.com"
proxy = '127.0.0.1:9050'
options.add_argument('--proxy-server=http://' + proxy)
try:
driver.get(url=url)
time.sleep(10)
except Exception as ex:
print(ex)
tor.kill()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question