Giter Club home page Giter Club logo

gtav-vehicles-web-scraping's Introduction

GTA V vehicles scraper


Typescript badge NodeJS badge Puppeteer badge Google chrome badge Web scraping badge

The project is a web scraper that searches for information and images of GTA V vehicles, the script can be modified to search in other web sources.

How to run

# To build the typescript project
npm run build

# To run the builded scraper
npm run start

Filters

All filters must be defined in the /src/index.ts file, instructions below.

Define the search sources

The first parameter in the scraper.start() method is the search source (required), you can choose and implement other options.

Sources:


const scraper = new Scraper();
await scraper.init();

const result = await scraper.start('wiki-rage');

Define vehicle categories to be excluded from the search

The second parameter in the scraper.start() method is the vehicle categories to be excluded (optional), you must define a string array that contains all the categories that you want to exclude.

Click here to view vehicle categories

const scraper = new Scraper();
await scraper.init();

const result = await scraper.start(
    'wiki-rage', 
    [
        'boats',
        'helicopters',
        'industrial',
        'planes',
        'service',
        'trailer',
        'trains'
    ]
);

Define vehicle to be excluded from search

The last parameter in the scraper.start() method is the vehicles to be excluded from the search (optional), you must define a string array that contains all the vehicles that you want to exclude.

const scraper = new Scraper();
await scraper.init();

const result = await scraper.start(
    'wiki-rage', [], ['benson', 'biff', 'cerberus', 'cerberus2']
);

Output folder

All scraped data will be created in

/build/result (production) /src/result (development)

๐Ÿ“ result
    โ•  ๐Ÿ“ images
    โ•š ๐Ÿ“„ result.json

result.json

It's the file with all the vehicles data separated by category

{
    "commercials": [
        {
            "vehicle_name": 'benson',
            "thumbnail_url": 'https://wiki.rage.mp/images/thumb/b/bd/Benson.png/164px-Benson.png',
        }
        // ... other vehicles objects
    ],
    "compacts": [...],
    "coupes": [...],
    "cycles": [...],
    "military": [...],
    // ... other categories
}

sample image Json crack editor

images

It's the folder where all images of the vehicle will be stored.

sample image

gtav-vehicles-web-scraping's People

Contributors

felipedasr avatar

Stargazers

 avatar  avatar  avatar

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.