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

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWaitdriver=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'

//待改

转载于:https://www.cnblogs.com/xiaobaichuangtianxia/p/3716493.html

AttributeError: 'WebDriver' object has no attribute 'switchTo'相关推荐

  1. AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘

    size = driver.get_window_size() # 获取手机屏幕大小,分辨率 print(size) 报错 AttributeError: 'WebDriver' object has ...

  2. AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘

    最近在做测试的时候发现driver.find_element_by_id的源代码改了如下: driver.find_element_by_id("j_username").send ...

  3. AttributeError: ‘LoginPage‘ object has no attribute ‘driver‘

    #简单的po模式 #2022/8/7 from selenium import webdriver from selenium.webdriver.common.by import Byclass L ...

  4. Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法

    今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...

  5. AttributeError: 'dict' object has no attribute 'status_code'

    前端AJAX请求数据,提示错误:"AttributeError: 'dict' object has no attribute 'status_code'". 原因:是提示返回对象 ...

  6. Traceback (most recent call last): File AttributeError: 'NoneType' object has no attribute 'group'

    Traceback (most recent call last):File "<stdin>", line 1, in <module> Attribut ...

  7. 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘

    解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...

  8. AttributeError: ‘FPDF‘ object has no attribute ‘unifontsubset‘

    AttributeError: 'FPDF' object has no attribute 'unifontsubset' 目录 AttributeError: 'FPDF' object has ...

  9. AttributeError: ‘Series‘ object has no attribute ‘as_matrix‘

    AttributeError: 'Series' object has no attribute 'as_matrix' 问题: y_test = test_shifted["y_t+1&q ...

  10. AttributeError: ‘SVC‘ object has no attribute ‘_probA‘

    AttributeError: 'SVC' object has no attribute '_probA' 问题: # Save the Modle to file in the current w ...

最新文章

  1. 使用SQL Server维护计划实现数据库定时自动备份
  2. 号称3个月发布最强量子计算机,卖口罩的霍尼韦尔凭什么?
  3. pythonpass函数_有的python内置函数怎么就一个pass?
  4. javadrawstring设置字符大小_LaTex学术写作——编辑文档格式 设置论文标题与摘要...
  5. 字符串匹配,KMP算法
  6. python3 centos7 Python.h无法找到
  7. TiDB 部署及数据同步
  8. 力扣有没有java_【Java】一篇文章带你玩转用Java刷力扣
  9. nms python代码_?标检测中的?极?值抑制算法(nms):python代码解析
  10. lightbox的一个ajax效果
  11. 用ajax请求豆瓣api,结合豆瓣Api v2.0实现Jsonp跨域
  12. HashMap底层原理详解
  13. HTML转PDF字体的坑,搞了半天
  14. java课程设计模拟科学计算器_JAVA课程设计科学计算器
  15. Windows10下取消五笔输入法Shift+Space全角半角切换
  16. C#在VS2019中各种字体颜色的意思
  17. ERROR: No matching distribution found for xxx
  18. Java Json格式化工具
  19. Advances in Financial Machine Learning 导言 (附pdf下载链接)
  20. 一文教你看懂Fama-French三因子模型

热门文章

  1. android http 本地 web服务(tomcat)
  2. 解决Oracle监听器服务不能启动的问题
  3. centos7搭建nexus maven私服
  4. 90 岁程序员,他的压缩算法改变了世界!
  5. “我男友是程序员,修BUG比我重要,服了!”
  6. 区块链:一场始料未及的革命
  7. 重磅!苹果正式开源iOS内核源码!
  8. 开源巨献:腾讯最热门30款开源项目
  9. 完美谢幕,这就是科比!
  10. 概率论与数理统计图解