Giter Site home page Giter Site logo

ufc-data-scrape's Introduction

UFC Data scraper

A set of scripts to pull data from wikipedia's ufc roster and ufcstats.com

There are two directories: 1) one for pulling .csv or .json data from wikipedia, and 2) another for pulling .csv or .json data from ufcstats.com

There is also a main script called wikiToUFCToJSON.py to fetch the active roster from wikipedia and then fill in stats and fight history from ufcstats.com. This way seems more efficient than saving 5000+ fighters from ufcstats directly.

Disclaimer: This is for educational and non-commercial purposes and projects. I tried to space out requests to not spam their server...

Example json output (complete data here)

Installation

First get your api keys for scraperapi, zenrows, or scraperbox, which have 1000-5000 free requests per month. Insert that at the top of the script, or in an .env file.

mkvirtualenv webscraping
cd ufc-data-scraper
pip install -r requirements.txt

Usage

python [script.py]
  • Data will be located in ./data/
  • You can import PyMongo to send data directly to your atlas database. It's commented right now, but just uncomment it and insert your MONGO_URI

Improvements

  • Pull data from UFC.com/athletes/all directly.
  • Run this as a cron job using anything you want
  • Instead of splitting this into many scripts, we could allow for CLI options to specify whether a user wants basic or detailed data, and .csv or .json output.
  • A lot of the names are hard-coded since there is a lack of consistency between wikipedia and ufcstats

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

ufc-data-scrape's People

Contributors

tmprk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.