#469·colly

Basic usage only shows a single link, but site is full of them

Author: mmmintCreated Apr 13, 2020Updated Aug 21, 2025
Labelsbug

While trying below code I only get a single link, but the website is full of links.

Visiting http://teenage.engineering

What is happening? Thanks for any hints.

package main

import (
	"fmt"
	"github.com/gocolly/colly"
)

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://teenage.engineering")
}