【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 ...
随机推荐
- 逃逸分析(Escape Analysis)
一.什么是逃逸 逃逸是指在某个方法之内创建的对象,除了在方法体之内被引用之外,还在方法体之外被其它变量引用到:这样带来的后果是在该方法执行完毕之后,该方法中创建的对象将无法被GC回收,由于其被其它变量 ...
- Delphi中Chrome Chromium、Cef3学习笔记(六)
原文 http://blog.csdn.net/xtfnpgy/article/details/71703317 一.CEF加载网页时空白 chrm1.Load(‘你的网址’); 出现空白,跟 ...
- HBASE分布式集群搭建(ubuntu 16.04)
1.hbase是依赖Hadoop运行的,因此先确保自己已搭建好Hadoop集群环境 没安装的可以参考这里:https://www.cnblogs.com/chaofan-/p/9740408.html ...
- pyhon的yileld的一点笔记
yield感觉很神秘,感觉也不好理解,学习pyhon最后终归是要学习这个东西,研究了一段时间,把自己的笔记写下来 说简单点就是遇到yield就停止往下执行代码,也包括不执行yield这条语句,然后返回 ...
- 【398】COMP9021 - Polynomial
构建 Polynomial 类,实现 +, -, , / and +=, -=, =, /= 参考:如何用python编程求解二元一次方程组.如x+y=3;x-y=1 参考:python对重载运算符的 ...
- [Sw] Swoole-4.2.9 可以尝试愉快应用 Swoole 协程
大家知道 Swoole 提供了方便于服务器.网络编程的模式,简化了多进程编程. 这直接让 PHP 的运行很容易变成常驻内存的 Server 程序,执行效率上有了数倍的提升. 但是这一切还没有让人足够兴 ...
- Hadoop学习笔记记录
NameNode的介绍: NameNode是HDFS的核心,也称为master,它仅存储元数据(文件系统中所有文件的目录树) NameNode不存储实际的数据或数据集,数据本身存储在DateNodes ...
- c++ protected 访问限定
class A { protected: int mA; }; class B : public A{ public: void Func() { mA = 0; // ok A *a = this; ...
- Tensorflow环境下安装Pandas
https://blog.csdn.net/fentone/article/details/78888136
- hadoop fs -text和hadoop fs -cat的区别(转)
转自:https://www.jianshu.com/p/4462613d3f57