【发布时间】:2019-11-12 13:00:47
【问题描述】:
我想使用 python 在网页上“单击”一个按钮。我正在尝试使用 selenium 包(如本示例中所示 how_can_i_essentially_click_a_button_on_a_webpage/),但在运行代码后立即收到以下消息:
我真的不明白发生了什么。 如果可能的话,我将不胜感激。
from selenium import webdriver
browsre = webdriver.Chrome()
Traceback (most recent call last):
File "C:\Users\pablo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 76, in start
stdin=PIPE)
File "C:\Users\pablo\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\pablo\AppData\Local\Programs\Python\Python36-32\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] El sistema no puede encontrar el archivo especificado
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
browsre = webdriver.Chrome()
File "C:\Users\pablo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 73, in __init__
self.service.start()
File "C:\Users\pablo\AppData\Local\Programs\Python\Python36-32\lib\site-packages\selenium\webdriver\common\service.py", line 83, 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
【问题讨论】:
-
你的问题是
chromedriver' executable needs to be in PATH...
标签: python selenium selenium-webdriver webdriver