A quick, hacked together Python program for scraping the MLB Showdown cards off http://www.showdowncards.com/mlb/ and putting them into a CSV.
- Activate a virutalenv with Pipenv
pipenv shell
- Install all deps (BS4, aiohttp)
pipenv install
- Run the program as a module:
python -m showdown-scraper
- For configuration:
usage: Showdown Scraper [-h] [--local LOCAL] [-c CONCURRENT] [-r RATE]
[-o OUT]
Scrape the showdown card site
optional arguments:
-h, --help show this help message and exit
--local LOCAL load local file for testing
-c CONCURRENT, --concurrenct CONCURRENT
Number of concurrent connections
-r RATE, --rate RATE Requests per second target
-o OUT, --outfile OUT
output file
This isn't great code, but it should work.