selenium报错
程序员文章站
2022-05-29 11:49:13
...
selenium定位时报错:
selenium.common.exceptions.ElementClickInterceptedException: Message: Element <span class="pager_next "> is not clickable at point (635,697) because another element <div class="foot-fix-ad-container-background"> obscures it
这是一种反爬机制,当要点击的按钮不在视野范围内时,就定位不到元素,所以需要移动滚动条,把要定位的元素显示在屏幕上。使用selenium执行js语句:
driver.execute_script("window.scrollTo(0, document.body.scrollHeight)")
推荐阅读
-
Python + selenium + requests实现12306全自动抢票及验证码破解加自动点击功能
-
Spring Cloud程序报错总结
-
JSONArray.fromObject不执行且不报错问题的解决
-
php报错502badgateway解决方法
-
解决cannot be cast to javax.servlet.Filter 报错的问题
-
python selenium执行所有测试用例并生成报告的方法
-
IIS访问ASP页面时报错The requested resource is in use.的解决办法
-
oracle 实际值超过数据库某个字段指定长度报错解决
-
CentOS安装Nginx 报错“configure: error: the HTTP rewrite module requires the PCRE library”解决办法
-
java selenium智能等待页面加载完成示例代码