Whitelists
Whitelisting domains is a process by means of which you explicitly allow your scraper to access certain websites. Any site listed on the whitelist is OK for the web scraper to access, whereas any site that is not listed is automatically skipped. This is a simple way to ensure that your scraper only accesses pages for a small set of specific sites, which helps in the collection of very focused information. You can take this even further by only allowing access to paths of a website.
Building a whitelist in Go is fairly simple with the use of the URL and path packages. Let's take an example of indexing articles on the Packt Hub site (https://hub.packtpub.com/). Many of the articles posted here contain links to external websites for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access