Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Chromedriver:&x201C;FileNotFoundError:[Errno 2]没有这样的文件或目录:”;错误_Python_Selenium Chromedriver - Fatal编程技术网

Python Chromedriver:&x201C;FileNotFoundError:[Errno 2]没有这样的文件或目录:”;错误

Python Chromedriver:&x201C;FileNotFoundError:[Errno 2]没有这样的文件或目录:”;错误,python,selenium-chromedriver,Python,Selenium Chromedriver,我解决不了这个问题。 我尝试了所有我能找到的解决办法,去下面的地址,但问题没有解决。 请帮帮我 节目: from selenium import webdriver driver = webdriver.Chrome("C:\chromedriver\chromedriver.exe") url = 'https://www.naver.com' driver.get(url) 错误: Traceback (most recent call last): File

我解决不了这个问题。 我尝试了所有我能找到的解决办法,去下面的地址,但问题没有解决。 请帮帮我

节目:

from selenium import webdriver

driver = webdriver.Chrome("C:\chromedriver\chromedriver.exe")
url = 'https://www.naver.com'
driver.get(url)
错误:

Traceback (most recent call last):
  File "/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py", line 76, in start
    stdin=PIPE)
  File "/usr/lib/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\chromedriver\\chromedriver.exe': 'C:\\chromedriver\\chromedriver.exe'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "modu_pers_auto.py", line 21, in <module>
    driver = webdriver.Chrome(chrome_options=options, executable_path=r"C:\chromedriver\chromedriver.exe", )
  File "/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/chrome/webdriver.py", line 73, in __init__
    self.service.start()
  File "/home/jsbang/.local/lib/python3.6/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: 'C:\chromedriver\chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
回溯(最近一次呼叫最后一次):
文件“/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py”,第76行,开始
标准偏差=管道)
文件“/usr/lib/python3.6/subprocess.py”,第729行,在__
恢复信号,启动新会话)
文件“/usr/lib/python3.6/subprocess.py”,第1364行,在执行子进程中
引发子项异常类型(错误号、错误消息、错误文件名)
FileNotFoundError:[Errno 2]没有这样的文件或目录:“C:\\chromedriver\\chromedriver.exe”:“C:\\chromedriver\\chromedriver.exe”
在处理上述异常期间,发生了另一个异常:
回溯(最近一次呼叫最后一次):
文件“modu_pers_auto.py”,第21行,在
driver=webdriver.Chrome(Chrome\u options=options,executable\u path=r“C:\chromedriver\chromedriver.exe”,)
文件“/home/jsbang/.local/lib/python3.6/site packages/selenium/webdriver/chrome/webdriver.py”,第73行,在__
self.service.start()
文件“/home/jsbang/.local/lib/python3.6/site-packages/selenium/webdriver/common/service.py”,第83行,开始
os.path.basename(self.path)、self.start\u错误消息)
selenium.common.exceptions.WebDriverException:消息:“C:\chromedriver\chromedriver.exe”可执行文件需要位于路径中。请看https://sites.google.com/a/chromium.org/chromedriver/home

如果可执行文件确实存在,则应给出有效路径:

("C:\\chromedriver\\chromedriver.exe")


我已经试过了。但问题并不顺利。
("C:/chromedriver/chromedriver.exe")