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

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

我希望能够编写一个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\\
python windows selenium-webdriver selenium-chromedriver tor
1个回答
0
投票

使用标准的selenium包不可能实现这一点。

您可以尝试使用this github存储库,它可以与pip install tbselenium一起安装

请注意,我自己没试过。

© www.soinside.com 2019 - 2024. All rights reserved.