AttributeError: 'WebDriver' object has no attribute 'switchTo'
不在错误中爆发,就在错误中死亡呀.
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait driver=webdriver.Firefox()
waitdd = WebDriverWait(driver, 30);
driver.get("http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert");
driver.switchTo().frame("iframeResult");
driver.findElement(By.xpath("//html/body/button")).click();
waitdd.until(ExpectedConditions.alertIsPresent());
driver.switchTo().alert().accept();
driver.switchTo().defaultContent();
报错内容:
Traceback (most recent call last):
File "D:\pcode\26.py", line 7, in <module>
driver.switchTo().frame("iframeResult");
AttributeError: 'WebDriver' object has no attribute 'switchTo'
//待改
AttributeError: 'WebDriver' object has no attribute 'switchTo'的更多相关文章
- AttributeError: 'WebElement' object has no attribute 'send_keys'
这个是没问题的代码:用来打开谷歌搜索cheese并退出 from selenium import webdriver from selenium.common.exceptions import Ti ...
- Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法
最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...
- AttributeError: 'list' object has no attribute 'write_pdf'
我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...
- attributeError:'module' object has no attribute ** 解决办法
写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...
- AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'
/*************************************************************************** * AttributeError: 'modu ...
- AttributeError: 'dict_values' object has no attribute 'translate'
/***************************************************************************************** * Attribu ...
- python3 AttributeError: 'NoneType' object has no attribute 'split'
from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...
- 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法
版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...
- AttributeError: 'module' object has no attribute 'Thread'
$ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last): File "th ...
随机推荐
- 跨域(六)——window.name
window.name也可以进行跨域数据传输. 下面是相应的代码,evil.html跨域读取foo.html的数据,其中proxy.html和evil.html同域,没有任何内容. evil.html ...
- VULKAN学习资料收集
https://github.com/vinjn/awesome-vulkan 张静初 https://zhuanlan.zhihu.com/p/24798656 知乎 https://develop ...
- 如何安全的在不同工程间安全地迁移asset数据?三种方法
答:1.将Assets和Library一起迁移2.导出包package3.用unity自带的assets Server功能
- data型怎么转换格式
data型如何转换格式01-1月 -03 如何转成 YYYY-MM-DD 的格式 本来就是date了 ------解决方案--------------------to_char ...
- 从初始化列表和构造函数谈C++的初始化机制
来源:http://blog.csdn.net/theprinceofelf/article/details/20057359 前段时间被人问及“初始化列表和构造有什么区别?”我竟一时语塞,只好回头 ...
- ReactiveX 学习笔记(11)对 LINQ 的扩展
Interactive Extensions(Ix) 本文的主题为对 Ix 库,对 LINQ 的扩展. Buffer Ix.NET Buffer Ix.NET BufferTest Buffer 方法 ...
- Shell函数使用方法
Shell函数是一组命令集或语句组成一个可用块.利用函数可以简化脚本编写.函数要求先定义再使用,调用函数时直接使用函数名即可.这里主要介绍shell编程中函数定义.调用.获取函数参数以及获取函数返回值 ...
- 24.Hibernate-各种类型的查询.md
目录 1.查询的类别 2.实例 1.查询的类别 按照查询的方式分为面向对象和非面向对象 面向对象 HQL查询:面向对象方式,可以跨数据库,但是需要SQL基础.最常用的方式.查询的对象是类和类的属性,不 ...
- server安装
ArcGIS Server Enterprise10 安装过程 1.ArcGIS Server Enterprise10 安装之前先检查下系统有没有安装IIS.右击电脑--管理--服务和应用程序--I ...
- 编程四剑客awk
awk 'pattern +{action}' file (1)AWK基本语法参数详解 a:单引号 ''是为了和shell命令区分开: b:大括号{}表示一个命令分组: c:pattern 是一个过 ...