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 · 6344 views
    This topic created in 2653 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   ·   3048 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 13:47 · PVG 21:47 · LAX 06:47 · JFK 09:47
    ♥ Do have faith in what you're doing.