苏飞论坛

标题: gehtml 返回Nothing的问题 [打印本页]

作者: morsth    时间: 2014-12-24 14:27
标题: gehtml 返回Nothing的问题
代码很简单,一个网站抓取网页

  Try
            Dim http As New HttpHelper
            Dim item As New HttpItem
            item.URL = url
            item.Host = "www.it-ebooks.info"
            Dim rshttp As HttpResult = http.GetHtml(item)

            Return rshttp.Html

        Catch ex As Exception
            Return "f"
        End Try



发现抓抓了四个连接后就返回为 Nothing 了, 然后把程序关了,重新开又可以了。不知道为啥,对方服务器限制吗?那为啥关了程序重新开又可以,总感觉是我本地的问题

作者: 站长苏飞    时间: 2014-12-24 14:47
这个真不清楚,可以提供一下Url看看
作者: morsth    时间: 2014-12-24 14:51
网址是 http://www.it-ebooks.info/ 我是抓去他的电子书页面   http://www.it-ebooks.info/book/****/   这种格式,头几次都没问题,一般是第四次后就返回nothing,重开程序又可以了。
作者: morsth    时间: 2014-12-24 14:52
如果用 webclient   httprequest 的方式也一样就报错 “基础连接已经关闭: 无法连接到远程服务器。”
作者: morsth    时间: 2014-12-24 15:11
在php里面用 file_get_contents 竟然毫无压力




欢迎光临 苏飞论坛 (http://www.sufeinet.com/) Powered by Discuz! X3.4