【发布时间】:2020-07-29 05:39:41
【问题描述】:
我正在尝试在 pycharm 中使用 selenium 打开 Firefox。我不知道问题是什么。
-我已经在正确的 PATH 中安装了 geckodriver。 (/usr/local/bin) - 我正在使用 pop_os 20.04 LTS
当我跑步时
from selenium import webdriver
driver = webdriver.Chrome(r'/usr/local/bin')
*Traceback (most recent call last):
File "/home/elliot/PycharmProjects/IG/venv/lib/python3.7/site-packages/selenium/webdriver/common/service.py", line 76, in start
stdin=PIPE)
File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin': '/usr/local/bin'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elliot/PycharmProjects/IG/igbot.py", line 3, in <module>
driver = webdriver.Chrome(r'/usr/local/bin')
File "/home/elliot/PycharmProjects/IG/venv/lib/python3.7/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
self.service.start()
File "/home/elliot/PycharmProjects/IG/venv/lib/python3.7/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: 'bin' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
Process finished with exit code 1*
【问题讨论】:
标签: python pycharm geckodriver