现在豆瓣爬不了了吗?
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
res, err := http.Get("https://douban.com/")
if nil != err {
fmt.Print(err)
}
body, err := ioutil.ReadAll(res.Body)
if nil != err {
fmt.Print(err)
}
fmt.Print(body)
fmt.Print(string(body))
}
![image.png](https://static.studygolang.com/200724/091a65d42f456951ee380ae2ff3de7e2.png)
有疑问加站长微信联系(非本文作者))