Python FileNotFoundError和WebDriverException

Python FileNotFoundError和WebDriverException,python,Python,我正在尝试运行Selenium,但出现了一些错误,你能帮我吗 FileNotFoundError和WebDriverException错误是我面临的问题 from selenium import webdriver PATH = (r"C:\Users\User\Desktop\selenium\chromedriver.exe") driver= webdriver.Chrome(PATH) driver.get("https://google.com/&quo

我正在尝试运行Selenium,但出现了一些错误,你能帮我吗

FileNotFoundError和WebDriverException错误是我面临的问题

from selenium import webdriver 
PATH = (r"C:\Users\User\Desktop\selenium\chromedriver.exe")
driver= webdriver.Chrome(PATH)
driver.get("https://google.com/")
我发现以下错误:

    FileNotFoundError                         Traceback (most recent call last)
c:\users\user\appdata\local\programs\python\python38\lib\site-packages\selenium\webdriver\common\service.py in start(self)
     71             cmd.extend(self.command_line_args())
---> 72             self.process = subprocess.Popen(cmd, env=self.env,
     73                                             close_fds=platform.system() != 'Windows',

FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

WebDriverException                        Traceback (most recent call last)
<ipython-input-4-3439d06e3794> in <module>
      3 PATH = (r"C:\Users\User\Desktop\selenium\chromedriver.exe")
      4 
----> 5 driver= webdriver.Chrome(PATH)
      6 
      7 driver.get("https://drpharmo.com/")

c:\users\user\appdata\local\programs\python\python38\lib\site-packages\selenium\webdriver\chrome\webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, keep_alive)
     71             service_args=service_args,
     72             log_path=service_log_path)
---> 73         self.service.start()
     74 
     75         try:
c:\users\user\appdata\local\programs\python\python38\lib\site-packages\selenium\webdriver\common\service.py in start(self)
     79         except OSError as err:
     80             if err.errno == errno.ENOENT:
---> 81                 raise WebDriverException(
     82                     "'%s' executable needs to be in PATH. %s" % (
     83                         os.path.basename(self.path), self.start_error_message)
WebDriverException: Message: 'chromedriver.exe' executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
FileNotFoundError回溯(最近一次调用)
c:\users\user\appdata\local\programs\python38\lib\site packages\selenium\webdriver\common\service.py(self)
71 cmd.extend(self.command\u line\u args())
--->72 self.process=subprocess.Popen(cmd,env=self.env,
73 close_fds=platform.system()!=“Windows”,
FileNotFoundError:[WinError 2]系统找不到指定的文件
在处理上述异常期间,发生了另一个异常:
WebDriverException回溯(最近一次调用上次)
在里面
3路径=(r“C:\Users\User\Desktop\selenium\chromedriver.exe”)
4.
---->5 driver=webdriver.Chrome(路径)
6.
7.获取(“https://drpharmo.com/")
c:\users\user\appdata\local\programs\python38\lib\site packages\selenium\webdriver\chrome\webdriver.py in\uuuuu init\uuuuuuuuuuuuuuuuu(self、可执行路径、端口、选项、服务参数、所需的功能、服务日志路径、chrome\u选项、保持活动状态)
71服务参数=服务参数,
72日志路径=服务日志路径)
--->73自助服务启动()
74
75尝试:
c:\users\user\appdata\local\programs\python38\lib\site packages\selenium\webdriver\common\service.py(self)
79除操作错误作为错误外:
80如果err.errno==errno.enoint:
--->81提出WebDriverException(
82“'%s'可执行文件需要位于路径中。%s”%(
83 os.path.basename(self.path)、self.start\u错误消息)
WebDriverException:消息:“chromedriver.exe”可执行文件需要位于路径中。请参阅https://sites.google.com/a/chromium.org/chromedriver/home
我试图使用chrome和chrome驱动程序浏览jupyter笔记本,但我发现了这些错误。 请帮帮我 谢谢大家:)
我知道了,我早些时候更改了文件名,并且没有编辑路径,所以我出现了这些错误

信息非常少。你有没有在谷歌上搜索并阅读错误?你在执行什么代码?如果您添加一个代码示例,则更容易将代码格式化到您的问题中,请不要共享图像,将stacktrace复制并粘贴到问题中好的,完成了