AttributeError: 'WebDriver' object has no attribute 'switchTo'
不在错误中爆发,就在错误中死亡呀.
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'相关推荐
- AttributeError: ‘WebDriver‘ object has no attribute ‘w3c‘
size = driver.get_window_size() # 获取手机屏幕大小,分辨率 print(size) 报错 AttributeError: 'WebDriver' object has ...
- AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_id‘
最近在做测试的时候发现driver.find_element_by_id的源代码改了如下: driver.find_element_by_id("j_username").send ...
- AttributeError: ‘LoginPage‘ object has no attribute ‘driver‘
#简单的po模式 #2022/8/7 from selenium import webdriver from selenium.webdriver.common.by import Byclass L ...
- Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法
今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...
- AttributeError: 'dict' object has no attribute 'status_code'
前端AJAX请求数据,提示错误:"AttributeError: 'dict' object has no attribute 'status_code'". 原因:是提示返回对象 ...
- 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 ...
- 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘
解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...
- AttributeError: ‘FPDF‘ object has no attribute ‘unifontsubset‘
AttributeError: 'FPDF' object has no attribute 'unifontsubset' 目录 AttributeError: 'FPDF' object has ...
- AttributeError: ‘Series‘ object has no attribute ‘as_matrix‘
AttributeError: 'Series' object has no attribute 'as_matrix' 问题: y_test = test_shifted["y_t+1&q ...
- AttributeError: ‘SVC‘ object has no attribute ‘_probA‘
AttributeError: 'SVC' object has no attribute '_probA' 问题: # Save the Modle to file in the current w ...
最新文章
- 使用SQL Server维护计划实现数据库定时自动备份
- 号称3个月发布最强量子计算机,卖口罩的霍尼韦尔凭什么?
- pythonpass函数_有的python内置函数怎么就一个pass?
- javadrawstring设置字符大小_LaTex学术写作——编辑文档格式 设置论文标题与摘要...
- 字符串匹配,KMP算法
- python3 centos7 Python.h无法找到
- TiDB 部署及数据同步
- 力扣有没有java_【Java】一篇文章带你玩转用Java刷力扣
- nms python代码_?标检测中的?极?值抑制算法(nms):python代码解析
- lightbox的一个ajax效果
- 用ajax请求豆瓣api,结合豆瓣Api v2.0实现Jsonp跨域
- HashMap底层原理详解
- HTML转PDF字体的坑,搞了半天
- java课程设计模拟科学计算器_JAVA课程设计科学计算器
- Windows10下取消五笔输入法Shift+Space全角半角切换
- C#在VS2019中各种字体颜色的意思
- ERROR: No matching distribution found for xxx
- Java Json格式化工具
- Advances in Financial Machine Learning 导言 (附pdf下载链接)
- 一文教你看懂Fama-French三因子模型