/shops-scraper

Shops scraper aims to collect data of a single product in different shops

Primary LanguagePythonMIT LicenseMIT

Shops Scraper

MIT License

Shops scraper aims to collect data of a single product in different shops

Technologies

selenium python mysql

About Instalation

Run the current project in a virtual environment and install the proper dependencies of this project.

$ virtualenv env
$ source env/bin/activate
$ pip install -r requirements.txt

Usage

To use the Scraper and Quoter, first emulate a local server and then run:

$ python .\src\run.py
Database 'shops_scraper' successfully created!
Connected to shops_scraper database.    
Table created successfully!
Type the product you want to be quoted: _______

This will create and connect to the proper database where products will be stored. Once you type the product, the scraper will open the browser to scrape the prices per store. Once scraped it will show the name, price and url of the products correctly succcessfully found. You will to enter the index of the product you want to continuosly quote (let's say the product to scrape was Iphone 11).

...
Product N° 16:
        Name: Apple iPhone 11 Pro
        Price: 490.0
        Url: https://www.amazon.com//-/es/iPhone-11-Pro-Apple/dp/B07ZQT1L6B/ref=sr_1_16?__mk_es_US=%C3%85M%C3%85%C5%BD%C3%95%C3%91&keywords=Iphone+13&qid=1692032389&sr=8-16

Enter the index of one of the products displayed above: 16

<Display of eBay products>
...
Product N° 40:
        Name: iPhone 13 128g negro usado probablemente solo para piezas
        Price: 249.0
        Url: https://www.ebay.com/itm/145238830305?hash=item21d0e8ace1:g:gVQAAOSwBTJk1urP&amdata=enc%3AAQAIAAAAwCpt2TXRiFpJbbbZi0%2B3SmC2IC%2BteQEF6aD622t5cqaBk6ZLjD7CtuFXwptN2Aw%2Bkm%2FHgAfunDKsqpI2wE38Lbj2T8lyibZwfwFl3ow2s0ctWMF2Lfwse96lEhrDOh5vob%2FRSV6%2FcNzP1qbb2DFjxyvRCsvrsbdh%2FmCU6c8w0tMccRPlh9HJqY4asYPtTTnBU4iB6ZDzDM%2BML%2F7VyZcnjoXD%2BYpF7xULvWzLobp3QxKP4j%2F8AV4pZ5MXrILTyoQw6g%3D%3D%7Ctkp%3ABk9SR-CE7M--Yg
Enter the index of one of the products displayed above: 25

Type the product you want to be quoted: _______

Once typed the indexes, the scraper will prompt you again the name of a different product if you want to quote another one.

In other console run the quoter (it is recommended to type a product to scrape before running the quoter).

$ python .\src\quoter.py
Starting quoting...

It will quote every hour if prices changed in the different products (price is displayed in USD for all the scraped products) and eventually will display notifications in desktop if there were a discount in the product.