The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
Chikenkk

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

  •  
  •   Chikenkk · Mar 20, 2019 · 6732 views
    This topic created in 2802 days ago, the information mentioned may be changed or developed.

    代码: 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
    aimerforreimu
    Mar 20, 2019 via Android
    1
    超时了,可能你的网络不好或或者 ip 被 ban 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1005 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 22:39 · PVG 06:39 · LAX 14:39 · JFK 17:39
    ♥ Do have faith in what you're doing.