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)
}
爬取整个豆瓣网页,后续更新