尝试为 Instagram 制作自动关注机器人

时间:2021-07-11 17:25:41

标签: python selenium selenium-chromedriver

from selenium import webdriver

from time import sleep

driver = webdriver.Chrome(executable_path=r'C:\Users\VANIKO\Desktop\chromedriver.exe')

driver.get("https://www.instagram.com/")
sleep(5)

但我收到以下错误消息:

selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary. 

2 个答案:

答案 0 :(得分:0)

我认为您应该定义 Chrome 浏览器可执行文件 sequence $ map beautyPrint splittedContent 的位置。
试试这个:

mapM_ beautyPrint splittedContent

只需验证您的 chrome.exe 是否已安装到我提到的默认位置。否则将其更改为 options = webdriver.ChromeOptions() options.binary_location = "C:\Program Files\Google\Chrome\Application\\chrome.exe" driver = webdriver.Chrome(chrome_options = options, executable_path=r'C:\Users\VANIKO\Desktop\chromedriver.exe') 在您的机器上所在的实际路径。

答案 1 :(得分:0)

看起来 chrome.exe 无法在您系统的默认位置找到 Chrome 二进制文件。

您可以使用 chrome 选项来定义谷歌浏览器的位置,如下所示:

LockExtender.extendActiveLock(Duration.of(5, MINUTES), ZERO);