‘WebDriver’ object has no attribute 'find_element_by_xpath’问题

以前习惯使用WebDriver来直接操作,比如:
dr = webdriver.Chrome()
dr.get(‘xxxxxxxxx/login’)
然后直接
dr.find_element_by_id
dr.find_element_by_xpath
现在好像不能这么使用了,这样就会报错’WebDriver’ object has no attribute ‘find_element_by_xpath’
解决这个问题需要额外导一个包
from selenium.webdriver.common.by import By
dr.find_element(By.XPATH,‘xxxxxXpath内容’)就OK了

解决‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘问题相关推荐

  1. 【趣解Bug】解决‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘问题

    今天换了个电脑,之前在旧电脑里运行的自动化测试脚本突然失灵了,真的让人头秃,先看看问题 报错信息中显示WebDriver没有属性find_element_by_xpath,这怎么可能,这些代码在之前电 ...

  2. selenium ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘解决方案

      大家好,我是爱编程的喵喵.双985硕士毕业,现担任全栈工程师一职,热衷于将数据思维应用到工作与生活中.从事机器学习以及相关的前后端开发工作.曾在阿里云.科大讯飞.CCF等比赛获得多次Top名次.现 ...

  3. AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘

    size = driver.get_window_size() # 获取手机屏幕大小,分辨率 print(size) 报错 AttributeError: 'WebDriver' object has ...

  4. AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘

    最近在做测试的时候发现driver.find_element_by_id的源代码改了如下: driver.find_element_by_id("j_username").send ...

  5. 【Python】成功解决 str object has no attribute decode

    首先需要知道的是:解码的是字节流,需要声明字节流 在python3中,str已经不再使用decode()方法直接给str解码:str直接作为unicode,对bytes字符串需要声明 In [1]: ...

  6. 解决 ‘Response‘ object has no attribute ‘body‘

    response.body 换成 response.content 试一下

  7. 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘

    解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...

  8. Keras问题“AttributeError: 'NoneType' object has no attribute 'update”解决

    BUG 在使用Keras训练模型时,在每个epoch完成后save_model时会报错 "AttributeError: 'NoneType' object has no attribute ...

  9. Python 报错解决:AttributeError: 'module' object has no attribute 'SSL_ST_INIT'

    早上升级完pip,后报错如下: -> # pip install --upgrade pwntools /usr/local/lib/python2.7/dist-packages/pip/_v ...

最新文章

  1. eBCC性能分析最佳实践(1) - 线上lstat, vfs_fstatat 开销高情景分析...
  2. 每日一皮:男人有三宝「胡子、发型和肌肉」...
  3. Node.js 博客实例(三)添加文件上传功能
  4. 帧同步和状态同步(一)
  5. Mac os区别_SN及Mac地址烧录
  6. 计算机盐城工学院和常熟理工,【选专业】这6所二本院校的专业,就业不输一本学生!...
  7. Jmeter跨线程组传递参数
  8. 演义群侠传(八)【bloom组件源码学习】
  9. HBase EndPoint加载失败
  10. Eclipse或MyEclipse—在Eclipse或MyEclipse中的操作(1)
  11. 【YOLO家族】【论文翻译】YOLO 9000 /YOLO V2
  12. POJ1015 Jury Compromise【背包问题】
  13. 数字系统设计与制作报告——双向流水灯控制电路
  14. python下载需要花钱吗,python下载要钱多少钱
  15. OI生涯回忆录(Part7:至高一湖南集训Day3)
  16. UE_LOG打印信息
  17. yield 和 yield*
  18. 虚拟服务器没有目录,云虚拟服务器指向目录
  19. Linux软件源更新地址
  20. 李航 统计学习方法 第二版 课后习题答案

热门文章

  1. supermap mysql_超图supermap sdx数据库用sql实现空间查询
  2. 区分触摸屏种类的几种方法
  3. 百城巡展 | 人大金仓3月山海之约圆满收官
  4. linux exchange 账号,linux exchange服务器配置
  5. logcat日志的五种级别
  6. 数据库 | Mysql - [索引]
  7. PHP+python+nodejs+ springboot+vue 社区互助平台
  8. excel表格汇总数据
  9. (附源码)计算机毕业设计SSM基于的楼盘销售系统的设计与实现
  10. 工作室多wifi软路由工作室Ros软路由使用教程