美文网首页
python+selenium 者常见错误

python+selenium 者常见错误

作者: 别动我名字呀 | 来源:发表于2018-08-14 23:09 被阅读53次

1.浏览器版本于driver与兼容,需要重新下载兼容浏览器版本的驱动

call function result missing 'value
 cannot get automation extension

解决方案:
Chrome 驱动地址:https://npm.taobao.org/mirrors/chromedriver/

参考版本:
chrome:67.0.3396.62(正式版本)
driver:2.37.0
注:64位计算机兼容32位

更多关于driver问题: chrome版本和chromedriver.exe

2.selenium 语法错误: Message: no such session

Traceback (most recent call last): File "E:/Python_selenium/PycharmProjects/data/run.py", line 22, in print(driver.title)

  File "E:\Python_selenium\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 222, in title

    resp = self.execute(Command.GET_TITLE)

  File "E:\Python_selenium\Python35\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 201, in execute

    self.error_handler.check_response(response)

  File "E:\Python_selenium\Python35\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 181, in check_response

    raise exception_class(message, screen, stacktrace)

selenium.common.exceptions.WebDriverException: Message: no such session

3.clear()无效的元素状态:元素必须是用户可编辑的,才能清除它。

invalid element state: Element must be user-editable in order to clear it.
首先需要确保这个元素能输入内容,如果可以send_keys(),却不能clear(),那么试试先对元素click(),让焦点在元素上再clear()

4.弹出Edit configuration 解决方案

在GitHub上下载了一个项目,导入后每执行一个模块都会弹出,如下图:(PS:因为问题发生时忘记截图,现在网上找了一个图)

Edit configuration

原因是 这个工程没有配置python解释器,具体设置方法如下:

1.打开File下的settings

settings

2.选择相应的python解释器后,点击Apply(必要步骤),点击OK,设置完成,此工程文件可以正常执行了

image.png

后面还会一直跟新,最近在看别的资料~,也希望大家能一起补充自己遇到的问题

selenium的常见异常

相关文章

  • python+selenium 者常见错误

    1.浏览器版本于driver与兼容,需要重新下载兼容浏览器版本的驱动 解决方案:Chrome 驱动地址:https...

  • Node.js十大常见的开发者错误

    原文地址:Node.js十大常见的开发者错误

  • 外汇交易之常见的外汇交易错误和陷阱(九)

    常见的外汇交易错误和陷阱 在外汇交易生涯中,有一些常见的错误和“陷阱”给几乎所有的交易者在某个时候带来麻烦。那么,...

  • click()不生效ElementNotInteractable

    python+selenium做UI自动化的时候,定位方式没有错误,但是就是点击不到元素,有以下三种解决方案: 1...

  • 常见错误

    1、spring默认只会扫描resources下的属性文件,而对于java包下的属性文件会被忽略。如果想要编译ja...

  • 常见错误

    错误1 导致原因 解决办法 错误二: library not found for - 参考 解决方法:获取 库...

  • 常见错误

    微信自定义菜单 EasyWechat :4.0最新版本 1.微信公众号配置网页授权域名微信报无法访问xxx.com...

  • 常见错误

    Test is not an annotation type描述:在使用junit进行单元测试时,在方法前声明@T...

  • 常见错误

    1、phpmyadmin 登录失败#1045无法登录MySQL服务器解决:(两种情况) 配置文件权限错误:修改ph...

  • 常见错误

    Permission Denial: opening provider 隐藏的android:exported属性...

网友评论

      本文标题:python+selenium 者常见错误

      本文链接:https://www.haomeiwen.com/subject/jowbbftx.html