Skip to main content

Creating a scraper for multiple fantasy football sites

Project description

fantasy-scraper

Trying to scrape all data from our fantasy league with NFL.com. Since we are moving to Sleeper. It might end up include myfantasyleague as well

Simple Usage

First off you will need to ensure you have chromedriver installed in your path StackOverflow. You should be able to set your path with PATH="$PATH:/usr/local/bin/chromedriver" or where ever your chromedriver is. If you can which chromedriver then you are good.

To use the package, you should be able to pull your league id from NFL.com, email, you know your password, and whatever you want to use for a name of the league (this does not need to be the actually name of the league)

_email="youremail@email.com"
_pass="TheP@SSWordYouUse"
_leagueid=123456
_name="Some random name"
python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps nfl_scraper

# Should work
nfl_scraper -e $_email -p $_pass -i $_leagueid -n $_name

# Could be
python3 run nfl_scraper -e $_email -p $_pass -i $_leagueid -n $_name

Developer Notes

If you are familiar with Python. You can work with the repo directly. Below are some of the steps I used to get the project running, building, etc...

Pipenv and Poetry

Setup

curl -sSL https://instcurl -sSL https://install.python-poetry.org | python3 -
pipenv install --python=/usr/loca/bin/python3.10
pipenv shell
poetry completions bash >> ~/.bash_completion
#export PIP_PYTHON_PATH="$VIRTUAL_ENV/bin/python3"
poetry new nfl_scraper
poetry new nfl_scraper
#pipenv install --index=pip
#pipenv install --index=distutils
poetry add requests
poetry add html5lib
poetry add bs4


#pip uninstall -y setuptools
#exit
#deactivate 

Running as locally Non Dev

poetry install --without dev --sync
poetry run python -V
# Help
poetry run python main.py -h 
# Sub out the params
poetry run python main.py -e <email> -p <password> -i <id> -n <name>
# Test need to beef these up
poetry run pytest

Running as Dev

poetry check
poetry build
#poetry update #gets latest package version

Running in CICD

poetry check
# output version
poetry version -s

poetry version major|minor|patch --dry-run

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nfl_scraper-1.0.4.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nfl_scraper-1.0.4-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

Details for the file nfl_scraper-1.0.4.tar.gz.

File metadata

  • Download URL: nfl_scraper-1.0.4.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.4 Linux/5.15.0-46-generic

File hashes

Hashes for nfl_scraper-1.0.4.tar.gz
Algorithm Hash digest
SHA256 64c69ff2b24e6528141c3a002e305d8a7e5375cbc5ac8724043ca21726b79d73
MD5 d467e7daf3c638491b5ed5c16315fdcf
BLAKE2b-256 8957fda0e78cee17fbfc5f6374e78267d95197a17d89aa1a2c24f8deb42b550d

See more details on using hashes here.

File details

Details for the file nfl_scraper-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: nfl_scraper-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.14 CPython/3.10.4 Linux/5.15.0-46-generic

File hashes

Hashes for nfl_scraper-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bfec9d68505d1ed183fa583533e447101bcdf828dbdb42dabae1b1d7945df193
MD5 fe24636b97692cefb00900337583c29a
BLAKE2b-256 d8db5f57c4d7c05621d4c357465c36562c34565357790efcc889690e04e2367f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page