MercadoLibre is Latin America’s largest e-commerce platform with over 170 million users.
As a result, MercadoLibre’s inventory is full of valuable product data. Specifically, if you’re looking for Latin American e-commerce data.
Unfortunately, MercadoLibre does not offer a way to export their inventory data into an Excel sheet. And on the other hand, extracting this data manually would take a very long time.
Web scraping is the solution to this problem.
MercadoLibre and Web Scraping
A web scraper will allow you to select the specific data you’d want to extract from MercadoLibre’s site and will extract it into an excel spreadsheet.
For this example, we will scrape MercadoLibre Mexico’s results page for the term “laptop”.
We will also use ParseHub, a free and powerful web scraper that can extract data from any website. Make sure to download and install ParseHub for free before we get started with our project.
Scraping MercadoLibre Data
Now it’s time to start our scraping project. Before we get started, make sure to download and install ParseHub for free.
Scraping the Results Page
- First, open ParseHub, click on “New Project” and enter the URL you want to scrape. ParseHub will render the page inside the app.
- Start by clicking on the name of the first product on the page. It will be highlighted in green to indicate that it has been selected.
- The rest of the listings will be highlighted in yellow. Click on the second product on the list to select them all. Rename your selection to product.
- ParseHub is now pulling the name and URL of every product on the page. Let’s now tell ParseHub to pull additional data.
- Start by clicking on the PLUS(+) sign next to your product selection and choose the Relative Select command.
- With the Relative Select command, click on the name of the first product and then on the seller name. An arrow will appear to show the selection you’re making. Rename your selection to seller.
- Repeat steps 5-6 to pull additional information. In this case, we will also pull the product’s price.
Scraping the Product Page
ParseHub is now scraping the data we selected from the search results page. But what if you want to extract more data? Let’s now tell ParseHub to click on every single listing and extract more data from the listing page.
- First, click on the PLUS(+) sign next to your product selection and choose the Click command.
- A pop-up will appear asking you if this a “next page” link. Click on No and enter a new template name. In this case, we will name it product_page.
- ParseHub will now render the listing page for the first product on the page and create a Select command.
- Now, you can click on additional information you’d like to extract from this page. For this example, we will extract the star rating and amount of units sold.
Dealing with Pagination
Now, ParseHub is only scraping the first page of the results page. So let’s set it up to scan more pages of results.
- First, go back to your main_template and the browser tab with the search results page.
- Now, click on the PLUS(+) sign next to your page selection and choose the select command.
- Scroll all the way down to the bottom of the page and click on the “next page” link. In this case, it says “Siguiente”. Rename your selection to next.
- Expand your next selection and remove the two extract commands under it.
- Click the PLUS(+) sign next to your next selection and choose the click command.
- A pop-up will appear asking you if this is a “next page” button. Click on Yes and enter the number of times you’d like this process to repeat. In this case, we will repeat it 5 times.
Running your Scrape
Now it’s time to run your scrape job. To do this, click on the green “Get Data” button on the left sidebar.
Here, you will be able to run your scrape job, test it or schedule it for later. For longer projects, we recommend you run a test run to verify all data is extracted correctly. In this case, we will just run it right away.
Now ParseHub will go and collect the information you requested and allow you to download it as an Excel or JSON file. In this example, it took about 2 minutes for ParseHub to collect all the data.
That’s all that there is to it! You know now how to scrape product data from MercadoLibre.
If you run into any issues while setting up your project, let us know via chat or email and we’ll be happy to assist you.