selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element
在输入框输入内容,点击【查询】,然后点击页面上的【处理】,并进行点击时,报错,报错内容如下。
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document
原代码:
#点击处理按钮
driver.find_element_by_id(‘ctl00_ContentPlaceHolder_RadGridList_ctl00_ctl04_btnHandle’).click()
参考博文后,加上了try except方法,成功点击了【处理】按钮,打开了新的页面。
https://blog.csdn.net/DaxiaLeeSuper/article/details/93747693
更新后代码:
e2=driver.find_element_by_id(‘ctl00_ContentPlaceHolder_RadGridList_ctl00_ctl04_btnHandle’)
print(e2.text)
try:
e2.click()
except Exception:
print(“出错了”)
e2 = driver.find_element_by_id(‘ctl00_ContentPlaceHolder_RadGridList_ctl00_ctl04_btnHandle’)
e2.click()
selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element相关推荐
- 已解决 selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element 找不到元素的问题
场景 使用selenium的find_element_by_xpath()函数报错:selenium.common.exceptions.NoSuchElementException: Message ...
- 已解决selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted:
已解决python selenium模块自动化操作浏览器点击元素,抛出异常selenium.common.exceptions.ElementClickInterceptedException: Me ...
- selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate elemen
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate elemen ...
- 解决selenium用cookies时候报错selenium.common.exceptions.InvalidArgumentException: Message: invalid argument
报错如下: selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: invalid 'xxxxx ...
- 报错:selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This versio
报错: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This versio ...
- selenium.common.exceptions.WebDriverException: Message: ‘chromedriver‘ executable needs to bein PATH
使用Selenium模拟浏览器访问淘宝首页,出现报警 from selenium import webdriver import timebrowser = webdriver.Chrome() br ...
- selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’解决
selenium.common.exceptions.WebDriverException: Message: 'chromedriver'解决: https://blog.csdn.net/weix ...
- 已解决 selenium.common.exceptions.NoSuchWindowException: Message: no such window
D:\学习\Python工程\venv\Scripts\python.exe "D:\软件\PyCharm Community Edition 2019.1.3\plugins\python ...
- 已解决selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
已解决selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary ...
最新文章
- 小圈子.大社交:利用圈子引爆流行
- 在eclipse中查看Android源代码
- 按时间取天和月的数据,和字符串截取函数
- 清华学霸直博简历火了:CPU、操作系统、编译器全自己写
- 关于中断和异常的几点认识
- 使用nrm管理npm源的切换
- 精益标准工时软件VIOOVI:没有标准工时,别谈精益改善!
- js创建a标签下载文件
- 浏览器h5拉起app 微信拉起app wx-launch-open-app
- 健身运动App需求分析
- eWebEditor的使用
- SitePoint播客#158:饮酒与技术
- ORA-29491: invalid table for chunking 错误记录
- 安安猜价格聪明机器人_2021年智慧树APP不动产估价第八单元章节测试答案
- 浅谈VMware的NAT模式
- [引擎搭建记录] 遮罩加速的软光栅遮挡剔除
- java坦克大战 实训报告_程序设计实训坦克大战实验报告
- 项目中使用过的Soc
- 触发浏览器回流的属性方法一览表
- 中职计算机专业英语课件,计算机专业英语课件—unit 1.ppt
热门文章
- 用完HttpWebResponse时别忘了调用Close方法
- 利用 Conda 尝鲜 Python 3.10 不一样的特性 快来试试
- php 利用redis写一个聊天室,使用Redis完成聊天室功能
- 小学计算机教师集体备课计实,教师集体备课活动记录表.doc
- elementui tree获取父节点_elementUI 树状图 点击子节点获取父节点
- Linux驱动段错误,linux驱动调试--段错误之oops信息分析
- oracle vm win10,win10系统oraclevm卸载不了错误2503的解决方法
- CFileStatus 使用详解
- 信息源按加工深度划分_工程勘察时如何划分地层?勘查总工实力整理
- 5件你可能不知道可以使用 CSS-in-JS 来做的事情