【发布时间】:2020-08-13 11:27:34
【问题描述】:
This is the screenshot of the error I'm getting.
我最近承担了使用 selnium webdriver 和 python 来学习功能测试和 Web 自动化的任务。当我执行我的代码时,Web 浏览器会打开,但 URL 不会。我已经尝试了互联网上的所有建议,例如:更新 chrome、尝试不同的 IDE、使用 FireFox。这些都没有帮助我的代码执行我想要的。
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
chrome = webdriver.Chrome(executable_path='/Applications/Google Chrome.app/Contents/MacOS/Google Chrome')
chrome.get('https://www.youtube.com/watch?v=oM-yAjUGO-E')
【问题讨论】:
-
executable_path应该指向chromedriver位置。你确定你说的是正确的位置吗? -
该位置可能是正确的,因为浏览器打开了,但如果不是,我如何在 Mac 上找到该位置。 @0buz
-
如果你在终端输入
which chromedriver,输出是什么? -
你指的是哪个终端?
-
命令提示符terminal.
标签: python selenium selenium-webdriver webautomation