Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Have you tried Zeal?
package main import ( "fmt" "regexp" "github.com/go-rod/rod" ) func main() { rootUrl := "https://go.dev/" browser := rod.New().MustConnect() page := browser.MustPage(rootUrl + "doc").MustWaitLoad() docs := page.MustElements("section.BigCard h3 a") for _, doc := range docs { // hack the urls because i'm lazy // ignore any external urls link := *doc.MustAttribute("href") re := regexp.MustCompile("^http") if re.FindString(link) == "" { title := doc.MustText() fmt.Println(title) reAbs := regexp.MustCompile("^/") if reAbs.FindString(link) != "" { link = rootUrl + link } else { link = rootUrl + "doc" + link } fmt.Println(link) browser.MustPage(link).MustWaitLoad().MustPDF(title + ".pdf") } } defer browser.MustClose() }
Some of the files used to serve the site are available in https://github.com/golang/website/. See in particular the directory _content/doc.