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 ...
随机推荐
- git rebase 合并提交 解决超过100M文件的提交不能推送问题
git log 现在可以看到有3个提交: change 1.mp4 size to small //发现不能推送,又改回小于100M add 1.mp4 big 改变为超过100M add 1.mp4 ...
- Kotlin语言学习笔记(1)
fun main(args: Array<String>) { println("Hello, World!") } 基本语法 声明常量用val,声明变量用var,声明 ...
- 知识点6: v-for列表循环
效果图: 只手写了第一个dom: 剩下4个dom由v-for生成. html <div class="item" id="item"> <di ...
- 做好Unity4.x开发项目规划
1. 是否要用lua 2. (对于需操作的游戏)客户端游戏如何做战斗验证 下面列举小坑吧.不建议都绕开,毕竟没有那么多时间做前期调研的. 对应版本Unity4.x 1. 客户端程序层面 总的来说C#超 ...
- PCA 降维
http://f.dataguru.cn/spark-751832-1-1.html 我们可以利用PCA算法将向量的维数降低,从而实现特征转化.具体原理在<机器学习>课程中有详细的讲述.故 ...
- 处女座和小姐姐(三)-数位dp1.0
链接:https://ac.nowcoder.com/acm/contest/329/G来源:牛客网 题目描述 经过了选号和漫长的等待,处女座终于拿到了给小姐姐定制的手环,小姐姐看到以后直呼666! ...
- Github好桑心,慢慢来吧,等待中
等了大半天还是没办法注册,在线求助...
- 清除 idea 缓存
idea最好选择 付费版本 ,稳定一点~ 不要选择社区版 1.问题使用idea启动项目时,报如下错误:Intellij Error: Internal caches are corrupted or ...
- xshell连接不上linux情况一
设置网络的地址使用桥接方式
- 初识Elasticsearch,bulk 操作的遇到的那些事
bulk api可以在单个请求中一次执行多个文档的 create . index . update 或 delete 操作 批量操作的行为(action)必须是以下几种: 行为 解释 create 当 ...