Colly: Golang编写的简单而强大的Web爬虫框架
By youbbs
at 2017-11-19 09:11 • 6183次点击
Colly 特性:
清晰的API 快速(单个内核上的请求数大于1k) 管理每个域的请求延迟和最大并发数 自动cookie 和会话处理 同步/异步/并行抓取 高速缓存 自动处理非Unicode的编码 Robots.txt 支持 Google App Engine 支持
func main() {
c := colly.NewCollector()
// Find and visit all links
c.OnHTML("a", func(e *colly.HTMLElement) {
e.Request.Visit(e.Attr("href"))
})
c.OnRequest(func(r *colly.Request) {
fmt.Println("Visiting", r.URL)
})
c.Visit("http://go-colly.org/")
}
项目地址 https://github.com/gocolly/colly 254
目前尚无回复
请 登录 后发表评论