不在错误中爆发,就在错误中死亡呀.

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'的更多相关文章

  1. AttributeError: 'WebElement' object has no attribute 'send_keys'

    这个是没问题的代码:用来打开谷歌搜索cheese并退出 from selenium import webdriver from selenium.common.exceptions import Ti ...

  2. Python脚本报错AttributeError: ‘module’ object has no attribute’xxx’解决方法

    最近在编写Python脚本过程中遇到一个问题比较奇怪:Python脚本完全正常没问题,但执行总报错"AttributeError: 'module' object has no attrib ...

  3. AttributeError: 'list' object has no attribute 'write_pdf'

    我在可视化决策树,运行以下代码时报错:AttributeError: 'list' object has no attribute 'write_pdf' 我使用的是python3.4 from sk ...

  4. attributeError:'module' object has no attribute ** 解决办法

    写了一个小脚本,执行的时候报错: Traceback (most recent call last): File "F:/test/qrcode.py", line 109, in ...

  5. AttributeError: 'module' object has no attribute 'TornadoAsyncNotifier'

    /*************************************************************************** * AttributeError: 'modu ...

  6. AttributeError: 'dict_values' object has no attribute 'translate'

    /***************************************************************************************** * Attribu ...

  7. python3 AttributeError: 'NoneType' object has no attribute 'split'

    from wsgiref.simple_server import make_server def RunServer(environ, start_response): start_response ...

  8. 对于AttributeError: 'Flask' object has no attribute 'cli'的解决办法

    版权声明:本文为博主原创文章,未经博主允许不得转载. 环境flask-script2.0.5.flask0.10.1 运行官方文档sample 出现问题 c:\kk\flask\examples\fl ...

  9. AttributeError: 'module' object has no attribute 'Thread'

    $ python thread.py starting at: 2015-08-05 00:24:24Traceback (most recent call last):  File "th ...

随机推荐

  1. Zabbix监控Zookeeper健康状况

    首先最简单的是监听服务端口,在zabbix界面直接添加监控项 item: zookeeper.status key: net.tcp.listen[2181]   ZooKeeper监控要点:   内 ...

  2. SQL 语句 写法

    SELECT * FROM article where  userid=4 order by sort asc LIMIT 0,10; 先根据写where 条件,再排序,在LIMIT.

  3. 更新package.json中的dependencies依赖到最新版本 -

    我们从别人那里下载一个项目 ,通过package.json里面的依赖 npm  install 来安装所需要的各个包 但是 有可能项目很老,我们一个个更新又很麻烦所以 https://blog.csd ...

  4. android布局管理器

    1 LinearLayout (线性布局) 让所有的组件都成为单一的方向,机垂直的或水平的(默认). android:Layout_weight //该属性控制水平和垂直方向某个控件所占比例. 2.F ...

  5. 【转】Unity网格合并_材质合并

    原帖请戳:Unity网格合并_材质合并 写在前面: 从优化角度,Mesh需要合并. 从换装的角度(这里指的是换形状.换组成部件的换装,而不是挂点型的换装),都需要网格合并.材质合并.如果是人物的换装, ...

  6. C# Excel转换为Json

    demo:https://files.cnblogs.com/files/guxingy/Excel%E8%BD%AC%E6%8D%A2%E4%B8%BAJson%E5%AF%B9%E8%B1%A1. ...

  7. Stm32 资料

    http://i.youku.com/i/UODMyMTgwNTY=?spm=a2hzp.8253869.0.0 http://blog.sina.cn/dpool/blog/s/blog_14f65 ...

  8. CommonJS/AMD/CMD/UMD

    为什么会有这几种模式? 起源:Javascript模块化 模块化就是把复杂问题分解成不同模块,这样可维护性高,从而达到高复用,低耦合. 1.Commonjs CommonJS是服务器端模块的规范,No ...

  9. node.js fs、http使用

    学习node核心模块http.fs;的使用 首先在server.js文件中require两个模块http.fs; let fs = require('fs')let http = require (' ...

  10. JDBC连接各种数据库的方法,连接MySql,Oracle数据库

    JDBC连接各种数据库的方法: JDBC编程步骤: 1.导入jar包 2.注册驱动 3.获取数据库连接对象 4.定义SQL语句 5.获得执行SQL语句对象statemnet 6.执行SQL语句 7.处 ...