当前位置:网站首页>selenium chrome driver运行时的cannot determine loading status from target frame detached问题
selenium chrome driver运行时的cannot determine loading status from target frame detached问题
2022-08-02 12:49:00 【bluepad】
selenium chrome driver运行时的cannot determine loading status from target frame detached问题
前言
最近在做本科毕业论文,计划用chrome driver爬取敦煌网,但是在爬取的过程中遇到了以下的问题,一直提示unknown error: cannot determine loading status from target frame detached。
WebDriverException Traceback (most recent call last)
WebDriverException: Message: unknown error: cannot determine loading status
from target frame detached
(Session info: chrome=99.0.4844.51)
1.chrome 和chrome driver版本问题
在网上看到有人说这是因为Google chrome和chrome driver的版本不兼容问题,但是我检查过我的软件版本之后发现不能帮助解决这个问题。
2.关闭科学上网软件
问题解决,好无厘头的错误原因啊。
3.换用BeautifulSoup
问题解决,selenium速度慢效率低,换用BeautifulSoup更加快速高效。
但是我在使用BeautifulSoup时多次出现timeout的报错,以下是我的两个解决方案。
1.设置断连时重新连接五次
requests.adapters.DEFAULT_RETRIES = 5
2.报错后强制sleep20秒
errortime = 0
try:
page_data = requests.get(page_url)
except OSError:
if errortimes == 0:
print("出错了!!!!!连接不上了!!!!!" + page_url)
time.sleep(20)
page_data = requests.get(page_url)
print("已经尝试重新连接了!!!!!")
else:
print("又出错了呀!!!!!" + page_url)
time.sleep(20)
page_data = requests.get(page_url)
print("已经尝试重新连接了!!!!!")
errortimes += 1
4.总结
作为爬虫小白真的踩了好多好多有意义和无意义的坑,毕竟困难总比办法多!!!
哪里写得不好或写错也请您指正!!!
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- 如何更好评估信用贷风险?看这场评分卡模型直播就可以了
- 最小割和对偶图(未完成)
- 如何搭建威纶通触摸屏与S7-200smart之间无线PPI通信?
- 动态组件-component
- Object.entries()
- Technology sharing | Description of the electronic fence function in the integrated dispatching system
- #Summer Challenge#[FFH] OpenHarmony Device Development Foundation (3) Compilation Dependencies
- FreeRTOS experiment -- delete task
- Pod调度策略:亲和性、污点与污点容忍
- Software component analysis: 5 major capabilities to protect software supply chain security
猜你喜欢
SQL Server如何建表
Seneor Exposure Basics
FreeRTOS experiment--one function creates multiple tasks
SQL Server修改数据
Data Lake (2): What is Hudi
工厂方法模式
Js scratchable latex style draw plug-in
SQL Server 2014 installation tutorial (nanny-level graphic tutorial)
The 7 most commonly used data analysis thinking, solve 95% of the analysis problems
一款强大的js弹出alert插件
随机推荐
The 7 most commonly used data analysis thinking, solve 95% of the analysis problems
pytorch模型转tensorflow模型
路由-Tab切换页面
新特性解读 | MySQL 8.0 GIPK 不可见主键
Js scratchable latex style draw plug-in
js九宫格样式抽奖插件
Four seasons of trees realized by svg
How to turn off hardware acceleration [easy to understand]
冰箱“扩容”的战事,在今夏格外猛烈
Interpretation of new features | MySQL 8.0 GIPK invisible primary key
Pod Scheduling Strategy: Affinity, Stain and Stain Tolerance
图神经网络(GNN)的简介「建议收藏」
Introduction to Graph Neural Networks (GNN) "Recommended Collection"
Chapter 14 Manually create a REST service (2)
图论之Kruskal,最小生成树如何优雅解题?
pgsql数据库实现导入导出
np.nan, np.isnan, None, pd.isnull, pd.isna finishing and summary
Data Lake (3): Hudi Concept Terminology
如何搭建威纶通触摸屏与S7-200smart之间无线PPI通信?
Intelligent Image Analysis-Intelligent Home Appliance Image Target Detection Statistical Counting Detection and Recognition-iCREDIT