eBay is the second largest global marketplace besides Amazon. Whether your website is competing with this marketplace or because you are directly selling there, you can gain powerful insights for your commercial strategy by analyzing eBay data. With our custom-built function, ImportFromWeb, you can easily scrape and extract data from eBay.
Follow the next steps to learn how you can scrape useful data quickly from eBay without having to worry to write complex code. It will be as easy as using a regular Excel function!
How does it work?
Our function, ImportFromWeb, is built on top of Google Sheets extending its functionalities. It can extract any element available on a webpage. You can retrieve directly in Google Sheets any information you need and cross it with other data sources. How cool is that?
The only pieces of information you need are:
- An URL or a list of URLs you want to scrape data from
- The Xpath or CSS of the elements you want to extract. If you are not familiar with this concept, don’t be afraid because we’ll provide them to you during this tutorial.
What are we going to scrape from eBay?
One of the most common data we would want to scrape from eBay are the key elements that can trigger or prevent a purchase, like the price and the availability. Let’s see how we can get this information directly into Google Sheets by simply using the ImportFromWeb function.
Get the product URLs we are going to scrape
The first step to scrape data from a list of products from eBay is simply to get their URLs. Select the product you want to extract data from and save their URLs.
Please note that you can use a shorter URL, using the eBay item number to build the URL:
We advise using this structure to avoid using a very long URL in your spreadsheet, even if there is no impact on how to follow the rest of this tutorial.Â
Include them in a Google spreadsheet
Once you have defined all the product URLs you want to scrape, include them in a Google spreadsheet:
Our formula will use this list as a crawler does: crawl them one by one and extract the data identified by the Xpath provided at the next stage.
List the Xpath you need
As explained at the beginning, if you want to scrape data from eBay using ImportFromWeb, you need to find the Xpath of the elements you want.
We created the following for you:
- Price: //*[@id=”prcIsum”]
- Title: //*[@id=”itemTitle”]
- Item condition: //*[@id=”vi-itm-cond”]
- Return policy: //*[@id=”vi-ret-accrd-txt”]
If you need to extract something else, you can follow our Xpath tutorial or get in touch with us and we’d be happy to help.
Add the Xpath to the Google Sheets
These Xpath will be used by our formula, hence you need to add it to the Google Sheets you use to extract your data.
Install and activate ImportFromWeb
To use our custom formula, you need to install it from the Google Marketplace and then activate it under Add-ons > IMPORTFROMWEB > Activate add-on.Â
This step is mandatory to be able to use the formula.
Run the function
We can now run our function, which needs only two parameters to work correctly:
=IMPORTFROMWEB(url_to_crawl;Xpath_of_elements_to_scrape)
How simple and cool is that?
To compare easily the scraped information, just add headers to your table:
And then use the function. Here we use a TRANSPOSE() function with our ImportFromWeb because, by default, results are stacked vertically and not horizontally.Â
But as you can see, data are successfully and easily scraped into your Google Sheets. You can obviously scrape more than 3 URLs, it depends on your need!
You can even schedule the update of your Google Sheets fields (every hour, every day…) to ensure you always have up-to-date information, which is very important if you are comparing yourself with the competition.
Did you find this tool useful?
We’d love to hear all of your feedback so that we can keep providing the best information on web scraping!