此问题已经在这里有了答案:
网络上有一些信息,其中大多数已经过时有谁知道,我们如何在Windows平台上使用Tor浏览器或使用TOR硒来请求?来自stackowerflow的所有其他答案均不起作用。.现在该更新答案了。.]
在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()