This command-line tool can retrieve football stats from the flashcore website. It uses the python scraping package, selenium.
We get the statistics on this type of page :
You can retrieve all types of stats that are offered on these pages by modifying the params.yml file.
All the stats are stored in a csv file.
- The chromedriver (download here)
- Python librairies : csv, argprse, tqdm, selenium, pyyaml
The repo is organized like this :
├── scraper
│ ├── scraper.py
│ └── ...
├── params.yml
├── images
└── ...
The params.yml file contains the urls and the stats that the program will scrape :
- Valid params stats are the titles of the stats found on the flashscore pages.
- Valid url params are flashscore urls that end with /results (ex: https://www.flashscore.com/football/italy/series-a-2018-2019/results/)
- Normal mode
python3 scraper.py [url file path] [csv file]
- Verbose mode
python3 scraper.py [url file path] [csv file] -v