Skip to content

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.

Notifications You must be signed in to change notification settings

FelipeDasr/gtav-vehicles-web-scraping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published