Giter Site home page Giter Site logo

seralexger / filmaffinity-scraper Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 15 KB

Unofficial class for scrap and recollect info from Filmmaffinity

Python 100.00%
dataset movie-database film-ratings dataset-generation dataset-creation dataset-description scraping scraper-engine

filmaffinity-scraper's Introduction

filmaffinity-scraper

I have built an unofficial class to give an easy way to interact with filmaffinity webpage.

Getting Started

First of all, unzip 'data / index.json.zip' and 'data / movies.zip', with this you will have practically all the base of films of the English domain of filmaffinity. All the necesary libraries for run the project are in the requirements.txt.

Use of the class

There is a simple practical example in get_movies_simple.py, to be more efficient and avoid possible IP blocking, everything is adapted to be able to use proxies. There is an example in get_movies_paralell_scrap.py, where apart from using proxies the task is parallelized.

from scraper.filmaffinity import Filmaffinity

film_scraper = Filmaffinity()

film_scraper.get_indice(proxy = None)
film_scraper.scrap_indice_web(indice_url, proxy = None)
film_scraper.scrap_movie_web(movie_url, lng = "en", proxy = None)
film_scraper.get_movie_review_indice(movie_id, proxy = None)
film_scraper.scrap_movie_review(movie_review_url, proxy = None)

Movie data scheme example

{
    "id": 201496,
    "title": "Iron Man",
    "movie_link_es": "https://www.filmaffinity.com/es/film201496.html",
    "movie_link_en": "https://www.filmaffinity.com/en/film201496.html",
    "director": [
        "Jon Favreau"
    ],
    "cast": [
        "Robert Downey Jr.",
        "Terrence Howard",
        "Gwyneth Paltrow",
        "Jeff Bridges",
        "Stan Lee",
        "Leslie Bibb",
        "Clark Gregg",
        "Shaun Toub",
        "Faran Tahir",
        "Samuel L. Jackson"
    ],
    "year": 2008,
    "duration": 126,
    "country": "United States",
    "screenwriter": [
        "Arthur Marcum",
        "Matt Holloway",
        "Mark Fergus",
        "Hawk Ostby (Characters: Stan Lee)"
    ],
    "music": [
        "Ramin Djawadi"
    ],
    "photo": [
        "Matthew Libatique"
    ],
    "producer": [
        "Paramount Pictures",
        "Marvel Enterprises",
        "Marvel Studios"
    ],
    "genre": [
        "Fantasy",
        "Action",
        "Adventure",
        "Sci-Fi"
    ],
    "subgenre": [
        "Superheroes",
        "Based on a Comic",
        "Marvel Comics",
        "Robots"
    ],
    "group": [
        "Marvel Cinematic Universe",
        "Iron Man"
    ],
    "rating": 6.5,
    "synopsis": "Tony Stark is a billionaire industrialist and genius inventor who is kidnapped and forced to build a devastating weapon. Instead, using his intelligence and ingenuity, Tony builds a high-tech suit of armor and escapes captivity. When he uncovers a nefarious plot with global implications, he dons his powerful armor and vows to protect the world as Iron Man. ",
    "rating_count": 87979,
    "movie_relations": [
        {
            "rel_id": 250528,
            "rel_title": "Iron Man 2",
            "rel_link": "https://www.filmaffinity.com/en/film250528.html"
        },
        {
            "rel_id": 857963,
            "rel_title": "The Invincible Iron Man",
            "rel_link": "https://www.filmaffinity.com/en/film857963.html"
        }
    ]
}

filmaffinity-scraper's People

Watchers

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