httplib 可以处理网页信息
包括以下操作

get的简单用法
package controllers
import (
"github.com/astaxie/beego/httplib"
"github.com/astaxie/beego"
)
//HttpLibController is a Controller to handel struct of models
type HttpLibController struct {
beego.Controller
}
//Get is a function
func (c *HttpLibController) Get() {
req := httplib.Get("http://www.douban.com")
str, err := req.String()
if err != nil {
panic(err)
}
c.Ctx.WriteString(str)
}
爬取整个豆瓣网页,后续更新
本文介绍如何使用Go语言中的httplib库进行网页爬取,通过一个实例展示了如何获取豆瓣网站的页面信息,并将结果输出。
310

被折叠的 条评论
为什么被折叠?



