42 lines
907 B
Markdown
42 lines
907 B
Markdown
# pcs_live
|
|
|
|
scrapes procyclingstats livestats homepage and timeline
|
|
|
|
timeline updates are simply the titles, so sometimes you get something like "ranking after x km" or "present riders today from last years top 20" with no details. for now i am not getting the details from underneath, because for the most part they can be ignored. the action timeline headings like "wheel change for x rider" are good enough when they come through.
|
|
|
|
# todo
|
|
|
|
- [ ] timeline items with details
|
|
- [ ] pypi package ??
|
|
|
|
# setup (windows)
|
|
|
|
after cloning set up a virtualenv
|
|
|
|
```
|
|
py -3 -m venv .venv
|
|
.venv\Scripts\activate
|
|
```
|
|
|
|
if you get an error while activating the virtualenv, you may need to run this first
|
|
|
|
```
|
|
Set-ExecutionPolicy Unrestricted -Force
|
|
```
|
|
|
|
install dependencies
|
|
|
|
```
|
|
pip install beautifulsoup4
|
|
pip install requests
|
|
```
|
|
|
|
# usage
|
|
|
|
```
|
|
from pcslive import LiveStats
|
|
|
|
stats = LiveStats()
|
|
stats.print_races()
|
|
```
|