Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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 3.x Selenium chromedriver不工作(Python)_Python 3.x_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

Python 3.x Selenium chromedriver不工作(Python)

Python 3.x Selenium chromedriver不工作(Python),python-3.x,selenium,selenium-webdriver,selenium-chromedriver,Python 3.x,Selenium,Selenium Webdriver,Selenium Chromedriver,我正在尝试创建一个程序来自动化我的Chrome浏览器。但是selenium chrome驱动程序不工作。它打开chrome 1-2秒,然后自动取消。然后给出这些错误。您有一个基本的语法问题。 试试这个: from selenium import webdriver driver = webdriver.Chrome('D:\python projects\chromedriver.exe') driver.get("https://www.youtube.com") 该错

我正在尝试创建一个程序来自动化我的Chrome浏览器。但是selenium chrome驱动程序不工作。它打开chrome 1-2秒,然后自动取消。然后给出这些错误。

您有一个基本的语法问题。 试试这个:

from selenium import webdriver

driver = webdriver.Chrome('D:\python projects\chromedriver.exe')
driver.get("https://www.youtube.com")

该错误意味着您的Chromdriver.exe未根据您的Google Chrom版本进行更新。 错误中说你的谷歌浏览器版本是90.0.443.212

这里:您可以下载chromedriver.exe


下载Chrome驱动程序,然后将其更换,这样就可以了。

的确如此。我想补充一点,如果您是python初学者,在开始使用selenium的PythonWebDriver绑定之前,最好先对该语言进行一些教育/练习。