开发者社区> 问答> 正文

运行OschinaBlogPageProcesser报timeout错误,求高手帮解决?报错

@黄亿华 你好,想跟你请教个问题:

在eclipse里搭建的环境,就是把webmagic源码放到工程里,然后运行OschinaBlogPageProcesser类,就报错,如下:

13-12-27 14:45:45,352 INFO  us.codecraft.webmagic.Spider(Spider.java:288) ## Spider my.oschina.net started!
13-12-27 14:45:45,354 INFO  us.codecraft.webmagic.downloader.HttpClientDownloader(HttpClientDownloader.java:99) ## downloading page http://my.oschina.net/flashsword/blog
13-12-27 14:45:50,458 WARN  us.codecraft.webmagic.downloader.HttpClientDownloader(HttpClientDownloader.java:131) ## download page http://my.oschina.net/flashsword/blog error
java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:136)
at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:152)
at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:270)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:140)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.http.impl.conn.CPoolProxy.invoke(CPoolProxy.java:138)
at $Proxy0.receiveResponseHeader(Unknown Source)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:253)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:194)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:85)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106)
at us.codecraft.webmagic.downloader.HttpClientDownloader.download(HttpClientDownloader.java:117)
at us.codecraft.webmagic.Spider.processRequest(Spider.java:369)
at us.codecraft.webmagic.Spider$1.run(Spider.java:304)
at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
at us.codecraft.webmagic.Spider.run(Spider.java:300)
at us.codecraft.webmagic.samples.OschinaBlogPageProcesser.main(OschinaBlogPageProcesser.java:33)


求高手解决,感激不尽。


展开
收起
爱吃鱼的程序员 2020-06-22 13:34:48 607 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    贴你写的爬虫类

    问题解决了,简直无语,myeclipse里搭建环境就报这个错,换成eclipse就没问题了

    2020-06-22 13:35:05
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载