基本上,在我的Mac上,selenium不起作用。我的代码是这样的:
from selenium import webdriver
webdriver.Safari('/usr/bin/safaridriver')这实际上是最基本的selenium脚本,但它不能工作……在我的程序运行了30秒之后,我得到了这个错误:selenium.common.exceptions.WebDriverException: Message: Can not connect to the Service /usr/bin/safaridriver。我不知道为什么会发生这种事。我的safari版本是最新的(14.0.1),但是我一直收到这个错误。谢谢你的帮助!
发布于 2021-01-03 11:17:48
传递给webdriver.Safari的第一个位置参数不是executable_path参数,而是port参数。您必须将路径作为位置参数进行传递。
webdriver.Safari(executable_path='/usr/bin/safaridriver')https://stackoverflow.com/questions/65545829
复制相似问题