Giter Site home page Giter Site logo

faridghr / productscraper Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 5 KB

Python software for extracting, storing product information and creating a laptop price prediction model from an ecommerce website.

Python 100.00%
beautifulsoup4 data-mo mysql python requests webscraper webscraping

productscraper's Introduction

ProductScraper

This Python project scrapes product information from the Digikala e-commerce website to extract details about available laptops, such as price, model, CPU, GPU, RAM, screen size, etc. The extracted data is stored in a MySQL database using the mysql library. Additionally, the project includes a simple machine learning model built with scikit-learn for predicting laptop prices based on user input configurations.

Features

  • Web Scraping: Scrapes product information from Digikala's laptop category.
  • Data Extraction: Collects details like price, model, CPU, GPU, RAM, screen size, etc., from each laptop listing.
  • Database Storage: Stores the extracted data in a MySQL database.
  • Machine Learning Model: Develops a simple price prediction model based on laptop configurations.

How It Works

  1. Find Number of Pages: Determines the number of pages available for the laptop category on the Digikala website.
  2. Loop and Extract Links: Iterates through each page, extracting links to individual laptop listings.
  3. Retrieve and Collect Data: Requests each laptop's URL and collects desired information.
  4. Decode and Store: Decodes the extracted information and stores it in a MySQL database.
  5. Model Creation: Builds a machine learning model using scikit-learn to predict laptop prices based on user-specified configurations.

Requirements

  • Python 3
  • Requests library
  • BeautifulSoup library
  • mysql library
  • scikit-learn library
  • MySQL database

Usage

  1. Clone the repository: git clone https://github.com/Faridghr/ProductScraper.git
  2. Install dependencies: pip install -r requirements.txt
  3. Set up MySQL database and configure connection settings.
  4. Run the main script to scrape data and store it in the database: python src/ProductScraper.py

productscraper's People

Stargazers

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