How to Scrape Costco Products

In this blog post, we will teach you how to scrape products from Costco’s website. Costco is the fifth largest retailer in the world and is continuously growing in new memberships. Scraping Costco’s website does not need to be hard. Sure you may make your own scraper, but ParseHub allows you to do it with zero coding knowledge.

Before you begin this tutorial, download ParseHub for free.

Let’s begin scraping Costco products!

  1. Firstly, download ParseHub for free and install it. Open the application and click “New Project” Input the Costco URL you want to scrape from, such as https://www.costco.ca/ground-coffee.html Then click enter and you will see the website loading on the right.
  2. Click the first product’s name to make it a selection. You will see the product name turn green. Click the next product name, which should be yellow. If you did this right, all the products should now show up as green.
  3. Rename this selection on the left to: “Products”
  4. To get the rest of the data for each product, such as the price, you need to ‘Relative Select’ it. Click the PLUS(+) sign next to the product selection, and click Relative Select.
  5. Now click on the first product and it should point an arrow. Click the price, and this should select all the prices for each product respectively. Rename this selection to “Price”.
  6. Repeat step 4 and 5 to get the rest of the data, such as reviews.

What about the next pages?

In order for ParseHub to extract data from more than one page, you need to add pagination to reach the next product pages. Here is how to set it up:

  1. Click the PLUS(+) sign and choose the select command on your “page”.
  2. Click the next button at the bottom of the page, the image below shows you where to click.
  3. Rename this selection to “pagination” and expand the data.
  4. Remove both the attributes that got added to the select, by clicking the icon next to the selection.
  5. Now click the PLUS(+) button next to the pagination selection, and choose the “click” command.
  6. A pop up will appear asking if the click is a next page link. Pick “Yes” and choose how many pages you want to scrape. If you leave it at zero, all pages will be scraped.

Bypassing Potential Blocks (Paid Feature)

Many websites block web scrapers from extracting data. On our scraping run, we noticed the results came back empty, which is usually an indicator of an IP block.

To bypass blocks, you need to enable the “Rotate IP Addresses” setting which is a paid ParseHub feature. To enable Rotate IP Addresses, click the settings cog at the top left of the screen. Then click “Settings” and tick the “Rotate IP Addresses” check box. Now you are ready to begin scraping Costco’s website.

Starting the Costco Product Scraping

To begin your scraping, click the green “Get Data” button on the left. Now we can test, run or schedule the scrape.

Begin your scrape by clicking the green “Run” button. Your data is now being scraped by ParseHub. Once finished, will also get an email notification that your scrape is complete! You will be able to download your file, and save it as a CSV or JSON.

We hope you enjoyed this blog post on scraping Costco products and data. If you need any help with your ParseHub scraping projects, feel free to reach out on our live chat.

Happy Scraping! 📊