Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/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
使用webdriver在Chrome和Python中运行_Python_Google Chrome_Selenium - Fatal编程技术网

使用webdriver在Chrome和Python中运行

使用webdriver在Chrome和Python中运行,python,google-chrome,selenium,Python,Google Chrome,Selenium,我一直在webdriver中使用Firefox。我想尝试使用Chrome。我已经下载了chromedriver并将其包含在Path变量中。但是,此代码返回一个错误: >webdriver.Chrome() selenium.common.exceptions.WebDriverException:消息:“chromedriver”可执行文件需要位于路径中。请看https://sites.google.com/a/chromium.org/chromedriver/home 我还尝试包括以下路径:

我一直在webdriver中使用Firefox。我想尝试使用Chrome。我已经下载了chromedriver并将其包含在Path变量中。但是,此代码返回一个错误:

>webdriver.Chrome()

selenium.common.exceptions.WebDriverException:消息:“chromedriver”可执行文件需要位于路径中。请看https://sites.google.com/a/chromium.org/chromedriver/home

我还尝试包括以下路径:

>webdriver.Chrome('C:\Python34\chromedriver\u win32.zip')

OSError:[WinError 193]%1不是有效的Win32应用程序

这里有什么问题?如果我做错了什么,或者我的问题似乎很难解决,我很抱歉。任何帮助都将不胜感激。我也在网上搜索过,但还没有找到任何东西


说真的,谁都不能解决这个问题吗?

结果是我必须解压文件夹,而不是键入文件夹的路径作为参数,您还必须在路径中提供.exe文件。也许这是一个断断续续的问题,或者只是在我发布问题时不起作用的问题。

为了简单起见,将
chromedriver.exe
与脚本放在同一个文件夹中。你必须提取zip文件夹,以获得必要的
chromedriver.exe
@malik,这似乎有点效果。出现其他错误:@ma
selenium.common.exceptions.WebDriverException:消息:“chromedriver\u win32”可执行文件可能具有错误的权限。请看https://sites.google.com/a/chromium.org/chromedriver/home