- macOS10.14
- 运行下面这个python时提示:
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
【from selenium import webdriver import time url = "https://www.hao123.com/" driver = webdriver.Chrome() driver.get(url) time.sleep(13)】
- 之前下载的chromedriver放错了位置导致!但是自己又不知道应该放在哪里?于是在网上找到了https://medium.com/@Epicure1709/%E4%BD%BF%E7%94%A8python%E7%9A%84selenium%E6%99%82%E9%81%87%E5%88%B0%E7%9A%84%E4%B8%80%E4%BA%9B%E5%B0%8F%E5%95%8F%E9%A1%8C-7fb5de198ff7
重新放置下chromedriver的位置
这个再运行代码,正常了!
mac系统chromedriver应该放的位置!usr/local/bin
最新推荐文章于 2024-03-14 16:30:06 发布