如何解决一个节点产生错误:到达超时:[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
有人可以帮我吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。