gpt4 book ai didi

python - 如何在Windows机器上的python中使用tor和selenium-webdriver?

转载 作者:太空宇宙 更新时间:2023-11-03 21:04:54 26 4
gpt4 key购买 nike

我希望能够编写一个 Instagram 机器人来自动评论图片。我已经弄清楚了正常的机器人部分,但我不知道如何使用 tor webdriver,所以我将能够定期更改我的 IP 地址,这样 Instagram 就无法阻止我。

from tbselenium.tbdriver import TorBrowserDriver
with TorBrowserDriver(r"\\C:\\Users\\simon\\Desktop\\Tor Browser\\Browser\\TorBrowser") as driver:
driver.get("https://www.google.com")

我尝试过,但它说:

tbselenium.exceptions.TBDriverPathError: TBB path is not a directory \\C:\\Users\\simon\\Desktop\\Tor Browser\\Browser\\TorBrowser\\

任何答案都值得赞赏!:)

编辑:

from tbselenium.tbdriver import TorBrowserDriver 
with TorBrowserDriver(r"\\C:\\Users\\simon\\Desktop\\Tor Browser\\Browser\\TorBrowser") as driver:
driver.get("google.com")

tbselenium.exceptions.TBDriverPathError: TBB path is not a directory \\C:\\Users\\simon\\Desktop\\Tor Browser\\Browser\\TorBrowser\\

最佳答案

由于兼容性问题,tbselenium 不适合你,请查看项目描述 https://github.com/webfp/tor-browser-selenium 。不支持 Windows 和 macOS。

关于python - 如何在Windows机器上的python中使用tor和selenium-webdriver?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55480311/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com