youbbs
youbbs
8921 0 0

Colly: Golang编写的简单而强大的Web爬虫框架

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

0

See Also

Nearby


Discussion

Login Topics