问题描述
想用golang做一爬虫小项目,安装golang包 PuerkitoBio/goquery 时发现被墙了超时
$ go get github.com/PuerkitoBio/goquery
package golang.org/x/net/html: unrecognized import path "golang.org/x/net/html" (https fetch: Get https://golang.org/x/net/html?go-get=1: dial tcp 216.239.37.1:443: i/o timeout)
解决
1、安装golang.org/x/net
golang的第三方包都会安装GOPATH
目录下
$ mkdir -p $GOPATH/src/golang.org/x/
$ git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net
$ go install net
2、安装PuerkitoBio/goquery
$ go get github.com/PuerkitoBio/goquery
原文链接:https://www.f2er.com/go/187336.html