关于python-selenium-chromedriver提示
问题一:AttributeError: module 'selenium.webdriver' has no attribute 'Chromedriver'
配置selenium环境时,执行代码
from selenium import webdriver
driver = webdriver.Chromedriver()
#driver = webdriver.Chromedriver(executable_path='C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe') driver.get('http:\\www.baidu.com')
提示如下报错
E:\code_study\python\python_study_list\venv\Scripts\python.exe E:\code_study\python\python_study_list\网络爬虫学习\study_selenium_1.py
Traceback (most recent call last):
File "E:\code_study\python\python_study_list\网络爬虫学习\study_selenium_1.py", line 5, in <module>
driver = webdriver.Chromedriver()
AttributeError: module 'selenium.webdriver' has no attribute 'Chromedriver' Process finished with exit code 1
后来发现:
将如下代码:
driver = webdriver.Chromedriver()
替换为:
driver = webdriver.Chrome()
即可。
还需要注意的是,工作目录下不要存在与库相关的同名文件,建议修改。
问题二: 谷歌浏览器与chromedriver.exe不匹配的问题
网上有对应的版本和chromedriver的对应关系,需要说明的是,你下载的最新版本的谷歌(比如我下的77版本),其实际安装的版本是76版本。所以需要下载对应76的版本chromedriver.exe文件。
关于python-selenium-chromedriver提示的更多相关文章
- python+selenium+chromedriver抓取shodan搜索结果
作用:免积分抓取shodan的搜索结果,并把IP保存为txt 前提: ①shodan会员(ps:黑色星期五打折) ②安装有python27 ③谷歌浏览器(ps:版本一定要跟chromedriver匹配 ...
- python Selenium chromedriver 自动化超时报错:你需要使用多标签保护罩护体
在使用selenium + chrome 作自动化测试的时候,有可能会出现网页连接超时的情况 如果出现网页连接超时,将会导致 webdriver 也跟着无法响应,不能继续进行任何操作 即时是去打开新的 ...
- python+selenium 元素被定位到而且click()也提示执行成功,但是页面就是没有变化和跳转。
python+selenium 元素被定位到而且click()也提示执行成功,但是页面就是没有变化和跳转. 如果多次定位和click(),有时候会跳转. 我遇到很多次就是很郁闷,有人说,操作太快的,页 ...
- 【转】【Python + selenium】linux和mac环境,驱动器chromedriver和测试报告HTMLTestRunner放置的位置
感谢: 作者:gz_tester,文章:<linux和mac环境,chromedriver和HTMLTestRunner放置的位置> 使用场景 配置python selenium 环境 使 ...
- 在Centos7上安装Python+Selenium+Chrome+Chromedriver
1.下载Chrome 上一篇文章已经演示过了Python+Selenium+Firefox+Geckodriver安装步骤并通过自动化脚本打开百度 因此当前只需要安装Chrome和Chromedriv ...
- python+selenium运行时,提示元素不可见
python+selenium运行多次新增项目脚本(出错的元素通过by_id的方式定位),当第三次新增时报Message: element not visible的错误,加入等待时间,等页面加载完成, ...
- python+selenium 自动化测试实战
一.前言: 之前的文章说过, 要写一篇自动化实战的文章, 这段时间比较忙再加回家过11一直没有更新博客,今天整理一下实战项目的代码共大家学习.(注:项目是针对我们公司内部系统的测试,只能内部网络访问, ...
- 使用Python + Selenium打造浏览器爬虫
Selenium 是一款强大的基于浏览器的开源自动化测试工具,最初由 Jason Huggins 于 2004 年在 ThoughtWorks 发起,它提供了一套简单易用的 API,模拟浏览器的各种操 ...
- python selenium 问题汇总
FAQ 1.python+selenium+Safari浏览器,定位元素 selenium.common.exceptions.ElementNotVisibleException: Message: ...
- python selenium 测试环境的搭建及python mysql的连接
又来一篇傻瓜教程啦,防止在学习的小伙伴们走弯路. 1.python 环境搭建 python官网:https://www.python.org/downloads/ 选择最新版本python下载(如果 ...
随机推荐
- 【Linux开发】linux设备驱动归纳总结(一):内核的相关基础概念
linux设备驱动归纳总结(一):内核的相关基础概念 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...
- default.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- sqlalchemy的join使用
——.先看mysql的join链接方法 #encoding: utf-8 from sqlalchemy import create_engine,Column,Integer,String,Floa ...
- Git 发生Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'.错误
Git 发生 Unable to create 'D:/Model/test/.git/index.lock': File exists. Another git process seems to b ...
- Luogu P2617 Dynamic Rankings(整体二分)
题目 动态区间第K小模板题. 一个非常可行的办法是BIT套动态开点权值SegTree,但是它跑的实在太慢了. 然后由于这题并没有强制在线,所以我们可以使用整体二分来吊打树套树. 当然如果强制在线的话就 ...
- EM 算法(三)-GMM
高斯混合模型 混合模型,顾名思义就是几个概率分布密度混合在一起,而高斯混合模型是最常见的混合模型: GMM,全称 Gaussian Mixture Model,中文名高斯混合模型,也就是由多个高斯分布 ...
- Ubuntu14.04安装Caffe(CPU)
一 安装Ubuntu14.04LTS Ubuntu分区 1.SWAP 交换分区:与物理内存相当. 2.“/” 根目录分区:该区大小由硬盘大小而定,10-100G. 3.“HOME” 家目录分区:该区也 ...
- C++ 数组操作符重载、函数对象分析、赋值操作符
string类型访问单个字符 #include <iostream> #include <string> #include <sstream> using name ...
- springboot mongodb jpa常用方法整理
官方文档https://docs.spring.io/spring-data/data-mongodb/docs/current/reference/html/index.html 查询: ***** ...
- git 常用命令语句(个人笔记)
切换账户 git config user.name xxxxx 查看用户名 ex: git config user.name tongjiaojiao git config user.e ...