GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ardilafabian/meli-scraper

BranchesTags
Open more actions menu

Latest commit

 

History

31 Commits
31 Commits

Folders and files

NameName
Last commit message
Last commit date
meli_scraper
meli_scraper
 
 
statics
statics
 
 
theorical_challenge
theorical_challenge
 
 
.gitignore
.gitignore
 
 
Competitive Intelligence Challenge.pdf
Competitive Intelligence Challenge.pdf
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 
scrapy.cfg
scrapy.cfg
 
 

Repository files navigation

Mercado Libre Scraper

This is a scraper software that retrieve data from the Mercado Libre web page, searching by the words celular smartphones and getting information of all the Samgung items that have the FULL service.

The program is developed using Scrapy Framework from Python because at the moment is one of the most powerful frameworks to crawl data from webpages using XPath language.

Since I have some experience using Python, this is my first scraper using Scrapy as a scraper framework and in order to accomplish this I had to complete some courses in record time. One of the biggest challenges was to understand how to use all the tools scrappy give me to develop a very efficient and professional piece of code.

Content table

  1. Installation
  2. Usage
  3. Technical (interesting) facts
  4. Future work
  5. License

Installation

  1. The prerequisite is to have Python installed in your machine. The program was developed with python v.3.10.1 you can use this one or grater versions to assure corrent behavior.
  2. You need to download this repository in your machine. You can clone the repository using Git and running the following command:
git clone https://github.com/ardilafabian/meli-scraper.git

If you don't have Git you can download the source code by clicking here.

  1. Now you have to access to the folder project. It's really recommended to use a python virtual environment to don't get a conflict while installing the project dependencies. You can check the documentation to initialize and activate a virtual environment with python here.
  2. Once you have your virtual environment activated you need to instal the project dependencies running the following command:
pip install -r requirements.txt
  1. Now that you have followed the steps above successfully you are able to use the scraper

Usage

When you are in the folder you have to run the following command in order to extract the data:

scrapy crawl meli

By default the algorithm will extract the data of the first 5 list pages, but you can modify this quantity by sending a parameter indicating the number of pages you want to scrap. To do this you need to run the following command:

scrapy crawl meli -a pages=<pages_number>

Replace <pages_number> with the number of pages you want.

When the execution has finished you will have two outputs.

  1. One of them is a .json file called items.json, you will find it in the root folder of the project. This file contains the structure of the items found that accomplish the conditions mentioned above and also you will find the attribute quantity that indicates the number of items found.

If you run the algorithm more than once, then remember to delete the items.json file if you don't want to append the new output in the same file

  1. The second output is in a MySQL database that lives in Google Cloud and it is going to be populated once you run the algorithm. The data normalized is seen as follow:

DB Image

If you are a tech savvy and you already have a MySQL client installed, then you would like to take a quick look at the 48 line of this super secret file.

Technical (interesting) facts

  • This algorithm was thought to be efficient and because of that the strategy is to internally extract only the nodes that accomplish the condition instead of get all nodes and check conditions after.
  • The algorithm verify duplicate elements when validate coincidence between item names and prices, this process is done in order to keep data as reliable as possible.
  • Before getting the output, the data extracted goes through two pipelines and one of them is in charge of cleanning the numerical data in order to keep the right type of values in our database. This will be useful at the moment of analyse the data directly in our database.

Future work

  • Add more custom parameters such URL to scrap
  • Access to each item to retrieve specific data such as caracteristics, vendor name, etc.
  • For a huge project it's really necessary to increase security. For example hosts and connection to DB should be kept in secrets in the cloud.
  • Separate environment variables according to the stage we are working on, i.e. production, development

License

MIT

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity

Stars

2 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.