Skip to content

akhoz/Web-Scraping-Game-Crawler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

74 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฎ Game Price Comparison Web Scraper

A full-stack web application that automates the process of finding the best game deals across multiple online stores. Built with Vue.js and Scrapy, this project delivers real-time price comparisons in an intuitive storefront interface.

Python Vue.js Flask Scrapy

๐Ÿ“‹ Overview

This application solves the common problem of comparing video game prices across different online retailers. Instead of manually checking multiple websites, users can view all pricing information in one centralized interface. The system automatically scrapes and updates game prices from major retailers, providing users with the most cost-effective purchasing options.

Key Features

  • ๐Ÿ” Multi-Platform Price Scraping: Automatically collects pricing data from G2A, Instant Gaming, PlayStation Store, Metacritic, and HowLongToBeat
  • ๐Ÿ’ฐ Real-Time Price Comparison: Displays current prices and discounts across all platforms
  • ๐ŸŽจ Modern UI: Clean, responsive storefront interface built with Vue.js and Element Plus
  • ๐Ÿ“Š Game Metadata: Includes ratings, playtime estimates, and detailed game information
  • โšก RESTful API: Flask backend provides structured API endpoints for game data
  • ๐Ÿ”„ Automated Updates: Scrapy spiders can be scheduled to refresh pricing data periodically

๐Ÿ—๏ธ Architecture

Frontend

  • Framework: Vue.js 3 with TypeScript
  • UI Library: Element Plus, Bootstrap 5
  • Routing: Vue Router 4
  • HTTP Client: Axios
  • Styling: Custom CSS with responsive design

Backend

  • Web Framework: Flask with CORS support
  • Web Scraping: Scrapy framework with custom spiders
  • Data Storage: JSON-based lightweight database
  • API: RESTful endpoints for game data retrieval

Web Scrapers

Custom Scrapy spiders for each platform:

  • G2A Spider: Scrapes prices, discounts, and product links
  • Instant Gaming Spider: Collects pricing and availability data
  • PlayStation Store Spider: Extracts console game pricing
  • Metacritic Spider: Gathers game ratings and reviews
  • HowLongToBeat Spider: Retrieves average playtime statistics

๐Ÿš€ Getting Started

Prerequisites

  • Python 3.8 or higher
  • Node.js 14 or higher
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone https://github.com/akhoz/Web-Scraping-Game-Crawler.git
    cd Web-Scraping-Game-Crawler
  2. Set up the Python backend

    # Install Python dependencies
    pip install flask flask-cors scrapy
  3. Set up the Vue.js frontend

    cd frontend
    npm install

Running the Application

  1. Start the Flask backend server

    # From the project root directory
    python main.py

    The API will be available at http://localhost:5000

  2. Launch the Vue.js development server

    cd frontend
    npm run serve

    The frontend will be available at http://localhost:8080

  3. Run the web scrapers (optional)

    cd GameCrawler/GameCrawler
    
    # Run individual spiders
    scrapy crawl g2a
    scrapy crawl instantGaming
    scrapy crawl playStation
    scrapy crawl metacritic
    scrapy crawl howlongtobeat

๐Ÿ“ Project Structure

Web-Scraping-Game-Crawler/
โ”œโ”€โ”€ main.py                      # Flask API server
โ”œโ”€โ”€ GameCrawler/                 # Scrapy project
โ”‚   โ””โ”€โ”€ GameCrawler/
โ”‚       โ”œโ”€โ”€ spiders/             # Custom web scrapers
โ”‚       โ”‚   โ”œโ”€โ”€ g2a.py
โ”‚       โ”‚   โ”œโ”€โ”€ instantGaming.py
โ”‚       โ”‚   โ”œโ”€โ”€ playStation.py
โ”‚       โ”‚   โ”œโ”€โ”€ metacritic.py
โ”‚       โ”‚   โ””โ”€โ”€ howlongtobeat.py
โ”‚       โ”œโ”€โ”€ items.py             # Data models
โ”‚       โ”œโ”€โ”€ pipelines.py         # Data processing
โ”‚       โ”œโ”€โ”€ settings.py          # Scraper configuration
โ”‚       โ””โ”€โ”€ data.json            # Scraped data storage
โ””โ”€โ”€ frontend/                    # Vue.js application
    โ”œโ”€โ”€ src/
    โ”‚   โ”œโ”€โ”€ components/          # Vue components
    โ”‚   โ”‚   โ””โ”€โ”€ GameCard.vue
    โ”‚   โ”œโ”€โ”€ views/               # Page views
    โ”‚   โ”‚   โ”œโ”€โ”€ HomeView.vue
    โ”‚   โ”‚   โ”œโ”€โ”€ GameDetailView.vue
    โ”‚   โ”‚   โ””โ”€โ”€ AboutView.vue
    โ”‚   โ”œโ”€โ”€ router/              # Route configuration
    โ”‚   โ”œโ”€โ”€ App.vue              # Root component
    โ”‚   โ””โ”€โ”€ main.ts              # Application entry
    โ””โ”€โ”€ package.json             # Frontend dependencies

๐Ÿ”Œ API Endpoints

Get All Games

GET /games

Returns a list of all games with pricing information from all scraped platforms.

Response Example:

[
  {
    "id": 1,
    "game_name": "Elden Ring",
    "game_price": "โ‚ฌ39.99",
    "game_rating": "9.5",
    "game_hours": "55",
    "platform": "G2A",
    "discount": "33%"
  }
]

Get Game by ID

GET /games/:id

Returns detailed information for a specific game.

๐Ÿ› ๏ธ Technologies Used

Frontend:

  • Vue.js 3
  • TypeScript
  • Vue Router
  • Axios
  • Element Plus
  • Bootstrap 5

Backend:

  • Python 3.8+
  • Flask
  • Flask-CORS
  • Scrapy
  • JSON

Tools & Practices:

  • RESTful API design
  • Web scraping with XPath selectors
  • Responsive design
  • Component-based architecture
  • TypeScript for type safety

๐Ÿ’ก Key Learnings & Achievements

  • Developed custom Scrapy spiders to handle dynamic web content across different site structures
  • Implemented efficient data aggregation from multiple sources
  • Created a responsive single-page application with Vue.js
  • Designed and implemented a RESTful API with Flask
  • Managed state and routing in a modern JavaScript framework
  • Applied web scraping best practices including error handling and rate limiting

๐Ÿ”ฎ Future Enhancements

  • Add user authentication and saved game lists
  • Implement price history tracking and charts
  • Add email notifications for price drops
  • Expand to include more gaming platforms (Steam, Epic Games, etc.)
  • Implement a PostgreSQL database for better scalability
  • Add automated scraping with scheduled tasks (Celery/Redis)
  • Create price prediction using historical data
  • Add filters and advanced search functionality

๐Ÿ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


โญ If you found this project interesting, please consider giving it a star!

About

A web scraper that crawls listed games from G2A, Instant Gaming and Play Station Store in order to public the cheapest in a public website with their own Metascore (from Metacritic) and Time to Achieve (from HowLongToBeat).

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors