Library for web-scraping Strava data.
Note: Strava does have a developer portal complete with a proper API and examples. This web-scraping based library was initially written years ago, before that API officially came about.
In no way does the author of this library advocate using it, particularly in any way that is abusive or in conflict with Strava's terms or developer guidelines. Proceed at your own risk!
$ pip install -r requirements.txt
Command line interface:
To simply login and get the HTML from the dashboard, use the scraper from the command line:
$ ./scraper.py "email@example.com" "your-password"
If there's a specific page you'd like to get info from, say the Rapha Rising challenge from 2012, pass that URL as the final argument:
$ ./scraper.py "firstname.lastname@example.org" "your-password" "https://www.strava.com/challenges/rapha-rising-circle-of-death"
To use the scraper from your own python code, you could do something like this:
from scraper import StravaScraper email = "email@example.com" password = "your-password" scraper = StravaScraper(email, password) scraper.login() dashboard_html = scraper.dashboard_content url = "https://www.strava.com/challenges/rapha-rising-circle-of-death" response = scraper.get_page(url) rapha_html = response.content