S
S
S1NYA2021-08-27 17:10:08
Python
S1NYA, 2021-08-27 17:10:08

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()

In debugging everything without errors

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question