Short web-scraping code to collect PGA Tour statistics from https://www.pgatour.com/stats.html
The code requires the year
and an optional stat id
as list inputs.
It consists of 2 parts:
- HTML Links Builder:
This part consists of building the html strings used in the next step.
It also retrieves a list ofstat id
which can be used for selection. - Web Scaping Loop:
This is where the web-scraping magic happens!
It loops through all the pages and spits out the data in a long format.