How to scrape all product color variants?

I am scraping a Shopify product website for a brand. That brand has multiple product color variants and when I scrape the product details page, only the default color details is scraped.

How can I scrape all the color variants for each product in the next row? Scraping color variants of a product become easy with Web Scraping Agent. Let’s see how?

Yes, you can extract the color variants from different websites, here is simple approach to scraping variants using this tool:

For example, I will use this example HTML page to showcase which has 3 colors variants as an option to select while making a purchase - product card shop -

Step 1 : Find the selector for colors, and add a field to scrape all colors first. In this case the selector is .swatches .swatch:nth-of-type(2) input and then I used the attribute option to extract the value attribute from this input html element.

Step 2 : Add other fields such as name, price and save your scraping agent and it will looks like this, by default -

Because 2 fields “product name” and “price” have 1 match, while the colors have 3 matches. So it’s taking 3 rows by default. You can always use the string join function to join more than one result together into one cell with comma separated(or some other delimiter).

Signup now to get 100 pages credit free

14 days free trial, no credit card required!