大佬教程收集整理的这篇文章主要介绍了Python Selenium Chrome Webdriver,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
您需要 。
从此处下载适用于所需平台的chromedriver。
将Chromedriver放置在系统路径或代码所在的位置。
如果不使用系统路径,请链接您的chromedriver.exe
(对于非windows用户,简称为Chromedriver
):
browser = webdriver.Chrome(executable_path=r"C:\path\to\chromedriver.exe")
(设置executable_path
为Chromedriver所在的位置。)
如果您在系统路径上放置了Chromedriver,则可以通过以下操作来实现快捷方式:
browser = webdriver.Chrome()
chmod +x Chromedriver
我开始自动化无聊的东西书,并且尝试通过python打开chrome网络浏览器。我已经安装了selenium和
我试图运行此文件:
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
browser = webdriver.Chrome()
browser.get('https://automatetheboringstuff.com')
但是正因为如此,我得到这个错误:
在处理上述异常期间,发生了另一个异常:
Traceback (most recent call last): File "C:/Program Files
(x86)/Python36-32/test.py",line 5,in <module>
browser = webdriver.Chrome() File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py",line 62,in __init__
self.service.start() File "C:\Program Files (x86)\Python36-32\lib\site-packages\selenium\webdriver\common\service.py",line 81,in start
os.path.basename(self.path),self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'chromedriver'
executable needs to be in PATH. Please see
https://sites.google.com/a/chromium.org/chromedriver/home
以上是大佬教程为你收集整理的Python Selenium Chrome Webdriver全部内容,希望文章能够帮你解决Python Selenium Chrome Webdriver所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。