Python爬取网页遇到:selenium.common.exceptions.WebDriverException解决方法
在PyCharm中写好下列程序:

一运行遇到下列报错:
selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home
于是在网上搜索了一下最终解决了我的问题,在这里记录一下:
1.先在Chrome地址栏中输入:chrome://version/ 查看浏览器的版本

2.进入网站:http://chromedriver.storage.googleapis.com/index.html 下载与自己浏览器相适配的driver


3.将下载好的压缩包解压后,将chromedriver.exe放在所写程序的目录中。

另:在网上还看到一种方法,但是对于我来说没有用(我也不清楚为啥没用),还是记录一下
将chromedriver.exe放在安装的selenium库下

4.运行所写程序,就没有出错啦!

Python爬取网页遇到:selenium.common.exceptions.WebDriverException解决方法的更多相关文章
- python+selenium,打开浏览器时报selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH
有一年多没写web自动化了,今天搭建环境的时候报了一个常见错误,但是处理过程有点闹心,报错就是常见的找不到驱动<selenium.common.exceptions.WebDriverExcep ...
- python爬取网页的通用代码框架
python爬取网页的通用代码框架: def getHTMLText(url):#参数code缺省值为‘utf-8’(编码方式) try: r=requests.get(url,timeout=30) ...
- Python爬取网页信息
Python爬取网页信息的步骤 以爬取英文名字网站(https://nameberry.com/)中每个名字的评论内容,包括英文名,用户名,评论的时间和评论的内容为例. 1.确认网址 在浏览器中输入初 ...
- 如何使用python爬取网页动态数据
我们在使用python爬取网页数据的时候,会遇到页面的数据是通过js脚本动态加载的情况,这时候我们就得模拟接口请求信息,根据接口返回结果来获取我们想要的数据. 以某电影网站为例:我们要获取到电影名称以 ...
- 运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created
运行python脚本报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created 原因: ...
- 【Python + Selenium】初次用IE浏览器之报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones.
初次用IE浏览器运行自动化程序时,报错:selenium.common.exceptions.WebDriverException: Message: Unexpected error launchi ...
- python无法启动火狐浏览器且报错“selenium.common.exceptions.WebDriverException: Message: Unable to find a matching set of capabilities”
安装了python2,使用pip安装了selenium,但是在使用时,报了“selenium.common.exceptions.WebDriverException: Message: 'gecko ...
- 解决selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in P
转载 解决selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be i ...
- centos7 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH
1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到 ...
- selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH. 错误处理方法
首次使用selenium webdriver,webdriver.Firefox() 报错selenium.common.exceptions.WebDriverException: Message: ...
随机推荐
- k8s架构解析
Kubernetes(K8s)是一个开源的容器编排平台,用于自动化部署.扩展和管理容器化应用程序.Kubernetes由多个组件组成,每个组件都扮演着不同的角色.以下是Kubernetes中一些主要组 ...
- html添加css样式的两种方法
html添加css样式有三种方法,分别为行内式(使用style属性,在特定的HTML标签内使用).内嵌式(style标签把css代码放在特定页面的head部分中).外联式(使用link标签,将外部 ...
- Kotlin学习快速入门(8)—— 委托
原文地址:Kotlin学习快速入门(8)-- 属性委托 - Stars-One的杂货小窝 委托其实是一种设计模式,但Kotlin把此特性编写进了语法中,可以方便开发者快速使用 委托对应的关键字是by ...
- decltype总结
decltype会识别const和引用 decltype一个表达式的时候会判断该表达式是左值还是右值,如果是左值就返回引用,否则就返回非引用. int &a = xx; const declt ...
- Android 开发Day5
展示项目 这是我的项目结构,补录的
- django(cookie与session、中间件、auth模块)
一 cookie与session 1 发展史及简介 """ 发展史 1.网站都没有保存用户功能的需求,所有用户访问返回的结果都是一样的 eg:新闻.博客.文章 2.出现了 ...
- 原型&继承题目及内容解答
这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助 1. 代码输出结果 function Person(name) { this.name = name } var p2 = new Per ...
- Orleans - 1 .NET生态构建分布式系统的利器
在当今数字化时代,构建高效.可靠的分布式系统是许多企业和开发团队面临的挑战.微软的 Orleans 框架为解决这些挑战提供了一个强大而简单的解决方案.本文将介绍 Orleans 的核心概念,并通过一个 ...
- Elastic实战:彻底解决spring-data-elasticsearch日期、时间类型数据读取报错问题
0. 引言在使用spring-data-elasticsearch读取es中时间类型的数据时出现了日期转换报错,不少初学者会在这里困惑很久,所以今天我们专门来解读该问题的几种解决方案. 1. 问题分析 ...
- oracle建表语句,添加主键、索引、注释,插入数据,添加序列
create table FND_COMPANIES_42624( COMPANY_ID number(3) primary key, -- 公司ID number 序列 COMPANY_CODE V ...