在Windows平台上使用TOR浏览器进行请求[重复]

问题描述 投票:0回答:1

网络上有一些信息,其中大多数已经过时有谁知道,我们如何在Windows平台上使用Tor浏览器或使用TOR硒来请求?来自stackowerflow的所有其他答案均不起作用。.现在该更新答案了。.]

python selenium browser request tor
1个回答
1
投票

在Windows上使用Selenium和Tor的工作示例:

from selenium import webdriver
from selenium.webdriver.firefox.firefox_profile import FirefoxProfile
from selenium.webdriver.firefox.firefox_binary import FirefoxBinary

binary = FirefoxBinary(r"..\..\..\firefox.exe")
profile = FirefoxProfile(r"..\..\..\TorBrowser\Browser\TorBrowser\Data\Browser\profile.default")

driver = webdriver.Firefox(profile, binary)
driver.get("http://www.google.com")
driver.quit()
© www.soinside.com 2019 - 2024. All rights reserved.