【Selenium】【BugList7】执行driver.find_element_by_id("kw").send_keys("Selenium"),报错:selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string
【版本】
selenium:3.11.0
firefox:59.0.3 (64 位)
python:3.6.5
【代码】
#coding=utf-8
from selenium import webdriver driver = webdriver.Firefox()
driver.get("http://www.baidu.com") driver.find_element_by_id("kw").send_keys("Selenium")
driver.find_element_by_id("su").click()
driver.quit()
【报错】
==================== RESTART: E:/python_work/1 firefox.py ====================
Traceback (most recent call last):
File "E:/python_work/1 firefox.py", line 7, in <module>
driver.find_element_by_id("kw").send_keys("Selenium")
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
return self._parent.execute(command, params)
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 312, in execute
self.error_handler.check_response(response)
File "D:\Program Files\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string
【解决方法】
升级geckodriver到v0.21.0已解决:https://github.com/mozilla/geckodriver/releases
【Selenium】【BugList7】执行driver.find_element_by_id("kw").send_keys("Selenium"),报错:selenium.common.exceptions.InvalidArgumentException: Message: Expected [object Undefined] undefined to be a string的更多相关文章
- 解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry'
解决selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'expiry' ...
- 报错:selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: missing 'name'
代码运行到这:driver.add_cookie(cookies),报错了 相信坑了不少人,接下来是解决办法 driver.add_cookie(cookies) cookies = { " ...
- Selenium click不生效 报错selenium.common.exceptions.InvalidArgumentException
记录在使用selenium过程中踩的坑------ 在使用selenium时,用click点击网站弹出的文件上传框的"上传文件"按钮不生效,报错selenium.common.ex ...
- 自动化上传图片,路径driver.find_element_by_id("oper-img-change").send_keys("C:\\Users\\76776\\Pictures\\logo.jpg"),为正确姿势,单\报错 'unicodeescape' codec can't decode bytes in position XXX: trun
自动化上传图片,路径driver.find_element_by_id("oper-img-change").send_keys("C:\\Users\\76776\\P ...
- robotframework执行用例时,报错selenium.common.exceptions.WebDriverException: Message: unknown error: cannot get automation extension from unknown error: page could not be found: chrome-extension://aapnijgdinl
在用robotframework编写移动端测试用例(用chrome浏览器模拟手机浏览器),执行用例时, 报错selenium.common.exceptions.WebDriverException: ...
- selenium.common.exceptions.ElementNotVisibleException: Message: element not visible处理方法:selenium针对下拉菜单事件的处理
使用Selenium爬虫时,可能会遇到一些下拉菜单,动态加载,如果直接使用find_element_by_函数会报错,显示selenium.common.exceptions.ElementNotVi ...
- selenium调用Firefox和Chrome需要注意的一些问题,和出现的报错selenium:expected [object undefined] undefined to be a string
在高版本selenium下如:selenium3.4.3 1.高版本的selenium需要浏览器安装一些补丁驱动 Firefox:geckodriver 下载网址:http://download.cs ...
- Python3+selenium 报错处理:“selenium.common.exceptions.NoAlertPresentException: Message: No alert is active”
一.说明 在使用python3+selenium写自动升级程序的时侯,碰到一个弹出对话框需要点击确认的场景.弹出的对话框如下图所示. 对于弹框各种资料都说通过switch_to.alert属性获取对话 ...
- Appium问题解决方案(5)- selenium.common.exceptions.InvalidSelectorException: Message: Locator Strategy 'name' is not supported for this session
背景 使用Appium Server 1.15.1版本 执行了以下脚本 test = driver.find_element_by_name("自动化测试") print(test ...
随机推荐
- 服务器硬盘--SAS盘和SATA盘
一.SAS和SATA SATA: Serial Advanced Technology Attachment,又叫串口硬盘,是将主机总线适配器连接到硬盘的总线接口. SAS: Serial Attac ...
- Django04-模板系统Template
一.模板支持的语法 Django模板中只需要记两种特殊符号: {{ }}表示变量,在模板渲染的时候替换成值{% %}表示逻辑相关的操作. 二. 变量(使用双大括号来引用变量) 1.语法格式:{{var ...
- Windows下pip 离线包安装
pip在线安装十分方便,有时候某些服务器并没有直接联网,需要下载好安装包上传到服务器上进行安装,不经常用,还是有点小麻烦的. 安装Python之后,将下载好的安装包包放在Python安装的根目录下使用 ...
- SQL Server 与MySQL中排序规则与字符集相关知识的一点总结
字符集&&排序规则 字符集是针对不同语言的字符编码的集合,比如UTF-8字符集,GBK字符集,GB2312字符集等等,不同的字符集使用不同的规则给字符进行编码排序规则则是在特定字符集的 ...
- git 之连接tfs的git服务器
tfs中的git的管理,注意区分是主页地址,还是代码地址,代码地址中会有 _git http://ip:8080/tfs/p/elasticsearch6.2.0 http://ip:8080/t ...
- CentOS中wget安装
通过linux text最小化安装或者安装Basic Server版本后出现的问题是wget命令不能使用了,这时可以使用rpm命令来安装wget.方法一.网络安装 rpm -ivh http:/ ...
- list.sort和内置方法sorted的区别
1.list.sort会直接修改list,不会把原来的列表复制一份,直接修改list,所以list.sort的返回值为None; 2.sorted(list)的返回值就修改之后的list,原来的lis ...
- Reactive Programming
Reactive的表现 Reactive 规范是 JVM Reactive 扩展规范 Reactive Streams JVM,而 Reactive 实现框架则是最典型的实现: Reactive St ...
- EF 数据迁移 常见错误
1.错误 “LC.exe”已退出,代码为 -1 原因:解决方案出错,而非迁移的项目
- 3D Math Keynote 2
[3D Math Keynote 2] 1.方向(diretion),指的是前方朝向.方位(orientation),指的是head.pitch.roll. 2.欧拉角的缺点: 1)给定方位的表达式不 ...