我试图使用SeleniumWebDriverFirefox通过9050端口的TorSocks5连接到一个特定的站点,但我无法建立连接。在
profile = FirefoxProfile()
profile.set_preference('network.proxy.type', 1)
profile.set_preference( "network.proxy.socks_version", 5 )
profile.set_preference('network.proxy.socks', '127.0.0.1')
profile.set_preference('network.proxy.socks_port', 9050)
profile.set_preference( "network.proxy.socks_remote_dns", True )
browser = webdriver.Firefox(firefox_profile=profile)
这个网站可能会阻止一些TOR连接,但奇怪的是我可以用TorBrowser连接到它!我甚至找到了TorBrowser使用的exit节点,并编辑了torrc文件以使用它(ExitNodes 'ip'
)。我检查了我的selenium Firefox的出口节点是否相同(我可以通过TOR代理成功连接到其他站点并检查我的ip),但我仍然无法连接,即使使用相同的ip!我的错误在哪里?在
第二件事是如果我设置了:
^{pr2}$即使用TorBrowser代理,selenium Firefox成功地建立了与站点的连接。在
我的设置有问题吗?在
要使用Selenium WebDriver、GeckoDriver和Firefox Firefox通过端口9050上的TorSocks5连接到特定站点,可以使用FirefoxProfile来使用以下解决方案:
相关问题 更多 >
编程相关推荐