Small, single-binary crawler that stays on one domain and exports page data to CSV.
- Go 1.25.5 (matches
go.mod)
Run directly with Go:
go run . https://example.com 5 100Build a binary and run it:
go build -o crawler .
./crawler https://example.com 5 100./crawler <URL> <maxConcurrency> <maxPages>Arguments:
URL: Starting page to crawl (must include scheme, e.g.https://)maxConcurrency: Maximum number of concurrent fetchesmaxPages: Maximum number of pages to crawl on the same domain
The crawl writes report.csv to the repo root with these columns:
page_urlh1first_paragraphoutgoing_link_urls(semicolon-separated)image_urls(semicolon-separated)
- Only crawls pages on the same hostname as the start URL.
- Skips non-HTML responses.
- Stops when
maxPagesis reached.
go run . https://golang.org 10 200After the run finishes, check report.csv for the results.