Using the goquery package for web scraping

The goquery package is not part of the standard library, but is available on GitHub. It is intended to work similar to jQuery—a popular JavaScript framework for interacting with the HTML DOM. As demonstrated in the previous sections, trying to search with string matching and regular expressions is both tedious and complicated. The goquery package makes it much easier to work with HTML content and search for specific elements. The reason I suggest this package is because it is modelled after the very popular jQuery framework that many people are already familiar with.

You can get the goquery package with the go get command:

go get https://github.com/PuerkitoBio/goquery  

The documentation is available ...

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.