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 · 6354 views
    This topic created in 2658 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
        1
    aimerforreimu  
       Mar 20, 2019 via Android
    超时了,可能你的网络不好或或者 ip 被 ban 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3120 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 12:45 · PVG 20:45 · LAX 05:45 · JFK 08:45
    ♥ Do have faith in what you're doing.