r - 一个节点产生错误:已达到超时:[www.website.com] 连接在 10001 毫秒后超时
问题描述
我正在尝试使用以下代码进行网络抓取,但我遇到了错误。
table_desc<-function(links){descriptions<-read_html(link_to_stats_tables[links])%>%html_nodes("[class='content-footer']")%>%html_nodes('p')%>%html_text()}
cores=detectCores()
cl <- makeCluster(cores)
clusterExport(cl,c("%>%","read_html","html_nodes","html_table","html_text","table_desc"))
system.time(alltables<-parLapply(cl,1:length(link_to_stats_tables),table_desc))
stopCluster(cl)
当我尝试只抓取少量文本时它工作正常,但我们在更大范围内运行它,它会吐出以下错误。
Error in checkForRemoteErrors(val) :
one node produced an error: Timeout was reached: [www.website.com] Connection timed out after 10001 milliseconds
Timing stopped at: 0.09 0.14 4124
任何人都可以帮我解决这个问题吗?
解决方案
推荐阅读
- javascript - Javascript 事件监听器行为
- rust - 什么时候需要绕过 Rust 的借用检查器?
- excel - 将外部枢轴转换为内部枢轴,反之亦然
- android - 通过 MoPub 中介将 GDPR 同意转发给 AdMob
- ios - Firebase - 如何为现有数据库中的每一行添加一个新字段?
- php - PDODriver Exception Doctrine 找不到驱动程序
- html - 使用 css 和 bootstrap 4 居中输入
- java - Java2EE总是使用MVC2架构?
- json - NSwag Angular 5 如何获得 json 响应?
- colors - Sphinx 文档包中 LaTeX 输出的自定义颜色