CAN'T Iterate through two item variation selects

Hello,
Using this web scraper tutorial I am trying to scrape this website

Many of the products have 2 attributes, Grit and Pack, which in the product page are button elements with the same class.
I can manage to get the info I need, sku,name etc, but only for the Grit Options, not the Pack, so I get half the job done. I don't know how to get it work.

The sitemap below is just for test purposes on a specific product, full sitemap contains more.

Please, I need some help.

Take this product for example:

.

Sitemap:

{"_id":"mirka2","startUrl":["https://www.mirka.com/en/p/NOVASTAR-125-----GRIP-89"],"selectors":[{"clickElementSelector":"button.filter:not(.disabled)","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":1000,"discardInitialElements":"discard-when-click-element-exists","id":"grit","multiple":true,"parentSelectors":["_root"],"selector":"main","type":"SelectorElementClick"},{"delay":0,"id":"grit option","multiple":false,"parentSelectors":["grit"],"regex":"","selector":"button.filter--big.selected","type":"SelectorText"},{"delay":0,"id":"sku","multiple":false,"parentSelectors":["grit"],"regex":"","selector":"p.f-normal","type":"SelectorText"},{"delay":0,"id":"name","multiple":false,"parentSelectors":["grit"],"regex":"","selector":"h2.m-b-6","type":"SelectorText"}]}

@Nikotinn Hello, it appears that you will have to use 2 separate 'Element click' selectors in this case which can be manually specified by the 'aria-label' attribute.

Example:

{"_id":"mirka2","startUrl":["https://www.mirka.com/en/p/NOVASTAR-125-----GRIP-89"],"selectors":[{"clickElementSelector":"button[aria-label*=\"Grit Options\"]:not(.selected )","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":1000,"discardInitialElements":"discard-when-click-element-exists","id":"grit-click","multiple":true,"parentSelectors":["_root"],"selector":"body","type":"SelectorElementClick"},{"delay":0,"id":"grit option","multiple":false,"parentSelectors":["pieces-per-pack"],"regex":"","selector":"button.filter--big.selected","type":"SelectorText"},{"delay":0,"id":"sku","multiple":false,"parentSelectors":["pieces-per-pack"],"regex":"","selector":"p.f-normal","type":"SelectorText"},{"delay":0,"id":"name","multiple":false,"parentSelectors":["pieces-per-pack"],"regex":"","selector":"h2.m-b-6","type":"SelectorText"},{"clickElementSelector":"button[aria-label*=\"Pieces per pack:\"]:not(.selected)","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":2000,"discardInitialElements":"discard-when-click-element-exists","id":"pieces-per-pack","multiple":true,"parentSelectors":["grit-click"],"selector":"_parent_","type":"SelectorElementClick"}]}

1 Like

You are amazing, thank you sooo much!! :slight_smile:

@ViestursWS Can you please also tell me an easy way to get the table below (Technical details)?
Not the HTML code, I would like to have each header and data rows as separate columns in my csv.

@Nikotinn To extract each of the attributes in a separate column you will have to apply the - ':contains()' selector.

Example:

div.technical-table-row:contains("Attachment Type") div + div
div.technical-table-row:contains("Backing Material") div + div, etc.

1 Like

You saved me!!
Thank you so much!! :slight_smile: