Do this

Solve the Web scraping in R course DataCamp. Read the selectorgadget vignette.

During class

IMPORTANT: The lack of an open API on a web site may indicate that the host is reluctant to share data. Respect this by not republishing their data without consent, see katalogskyddet for the Swedish legal rights.

Note that there is also a R package robotstxt, which uses an informal standard for specifying up to what degree scraping etc. is allowed on a website. Check the pkg vignette for further information.

Bokus top sellers

Scrape title, author, rating, price, … on books listed at pockettoppen (some may be extracted with html_text, others with html_attr). Make use of the selectorgadget to learn about the structure of the webpage!

SHL players

Dagens Nyheter news

Scrape the headlines at https://www.dn.se/.