V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
Chikenkk
V2EX  ›  Go 编程语言

golang 写爬虫出现 net/http: request canceled (Client.Timeout exceeded while reading body)

  •  
  •   Chikenkk · 2019-03-20 02:04:01 +08:00 · 5515 次点击
    这是一个创建于 1863 天前的主题,其中的信息可能已经有所发展或是发生改变。

    代码: if resp.StatusCode == http.StatusOK { body, err := ioutil.ReadAll(gbody) if err != nil { fmt.Println("返回 html 内容错误", err) htmlbodyerrorsum++ return "","" } return string(body), resp.Request.URL.String() }

    报错: 返回 html 内容错误 net/http: request canceled (Client.Timeout exceeded while reading body)

    有大神指教一下如何解决这个问题吗

    aimerforreimu
        1
    aimerforreimu  
       2019-03-20 10:55:48 +08:00 via Android
    超时了,可能你的网络不好或或者 ip 被 ban 了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3544 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 00:09 · PVG 08:09 · LAX 17:09 · JFK 20:09
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.