This is an extensive webscraper using requests
, BeautifulSoup
and pandas
that creates a data frame of test match innings for a given cricketer using ESPN cricinfo's web pages.
Functionality has been wrapped inside a Cricketer
(found here) class that allows for the application of methods to produce summary statistics and rolling averages that can be used to analyse the overall performance of the player simply by passing in the link for that player.
Further information can be gained about the performance through subsequently scraping the particular match using Match
and Innings
classes allowing for a wider range of metrics to be analysed.
Below are some visualisations that were created for an article that I wrote: Has captaincy ruined Joe Root?
The code used to produce them can be found in this notebook.