Coder Social home page Coder Social logo

scrapefandom's Introduction

This is a simple Python3 script to scrape Fandom site and get much information on various items available in the game.

List of defined numeric IDs is from here with minor editing and corrections (BEWARE: I might have goofed badly!).

Installation under Linux is straightforward (I don't use Windows for programming):

# clone reository
git clone <repository>
#enter project root directory
cd ScrapeFandom/
# create basic Vitual ENVironment 
python3 -m venv venv
# install required non-standard-lib packages
# i.e.: lxml and requests
venv/bin/pip install -r requirements.txt
# run the script
venv/bin/python ParseFandom.py 

After execution (it takes a bit of time) you should have several new files: the most important are:

  • Fandom.py: the resulting script containing the whole scraped information in list format and a couple of helper dicts:

    • all_by_id[int]: access info by ID value
    • all_by_name[int]: access info by in-game name
  • resources/images/*: collection of images pertaining to objects.

    Names are computed from in-game item name.

    Note: These are images and not the icons used in-game as I didn't find a reliable way to getthem fromFandom. I am thinking about scraping them from Fextralife but that's for another day.

In the code there are several workarounds needed to account for differences in Wiki pages edited over a quite sizable time span. I wouldn't be surprised if "further enhancements" will break the scraping code; please notify me if you find inconsistencies.

Suggestions and comments (and patches) are always welcome.

Enjoy!

scrapefandom's People

Contributors

mcondarelli 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.