Skip to content

A django website that scrapes NBA Top Shot floor price data using Selenium and a Celery worker

Notifications You must be signed in to change notification settings

acunap5/ts__floor

Repository files navigation

Top Shot Floor

A Django Website that Scrapes TS Floor Prices and stores historical data on each moment

Installation

Make sure to install the following:

  • pip our python package manager
  • redis for our celery broker
  • chromedriver, the current chromedriver in the project is the one that works on my personal computer make sure to download correct verison given your chrome version

Environment Set-Up

Set up is rather easy with the pipenv package simply run the following terminal commands in the project directory

pip install pipenv
pipenv shell
pipenv lock
pipenv install

Just like that all the dependecies for the project are installed in our virtual environment! To run the server, execute the following in the pipenv shell

python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

Celery Broker and Scrapper

To start scrapping you will need to start up the redis server, open up a new terminal where you installed redis and run

redis-server

Now that thats running, open two new terminals in your pipenv environment and run each in a different shell

celery -A topShotScrapper worker -l info
celery -A topShotScrapper beat -l info

It is currently configured to run every hour as it takes ~20 minutes to scrape every moment. To edit how many teams you want to scrape go to core/tasks.py and lower the upperbound of the for loop. To edit the scheduler go to topShotScrapper/settings.py and go to the CELERY_BEAT_SCHEDULE and change the schedule value (in seconds).

Here are some screenshots of the finished project

Home Screen




Moment Data




Sets




Detailed Set

About

A django website that scrapes NBA Top Shot floor price data using Selenium and a Celery worker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages