package main import ( "fmt" "github.com/gocolly/colly" ) func main() { // 使用默认设置创建收集器: c := colly.NewCollector() // Find and visit all links c.OnHTML("a[href]", func(e *colly.HTMLElement) { e.Request.Visit(e.Attr("href")) }) c.OnRequest(func(r *colly.Request) { fmt.Println("Visiting", r.URL) fmt.Println("HTML", r.Body) }) c.Visit("https://www.viviman.top/") }