Duplicated items with double Element Click in Sitemap

HI!

I was looking for decision here, but there is nothing exactly as my problem (or I can't find).

I need to scrap prices from i-market with 2 changeable elements: size and color. As a result have duplicates. Please, help to newcomer.

Sitemap:
{"_id":"feline_hexagons","startUrl":["https://petshelperco.com/collections/cat-cubes/products/feline-hexagons"],"selectors":[{"id":"results_size","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"div.medium-up--one-half:nth-of-type(2)","multiple":true,"delay":"500","clickElementSelector":"select.single-option-selector option ","clickType":"clickOnce","discardInitialElements":"discard-when-click-element-exists","clickElementUniquenessType":"uniqueCSSSelector"},{"id":"pre_result","type":"SelectorElementClick","parentSelectors":["results_size"],"selector":"parent","multiple":true,"delay":"500","clickElementSelector":"select.single-option-selector option","clickType":"clickOnce","discardInitialElements":"discard-when-click-element-exists","clickElementUniquenessType":"uniqueCSSSelector"},{"id":"price","type":"SelectorText","parentSelectors":["pre_result"],"selector":"span.price-item--sale","multiple":false,"regex":"","delay":0},{"id":"chosen_size","type":"SelectorText","parentSelectors":["pre_result"],"selector":"select#SingleOptionSelector-0 option[selected]","multiple":false,"regex":"","delay":0},{"id":"chosen_color","type":"SelectorText","parentSelectors":["pre_result"],"selector":"select#SingleOptionSelector-1 option[selected]","multiple":false,"regex":"","delay":0}]}

Almost there. The issue you were having was that both of the drop-downs were selected with the same selector, so the scraper was clicking through all of them as if they were a part of the same element. You just needed to specify a bit more which click should be associated with which drop-down.

Something along these lines:

{"_id":"feline_hexagons-v2","startUrl":["https://petshelperco.com/collections/cat-cubes/products/feline-hexagons"],"selectors":[{"id":"results_size","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"body","multiple":true,"delay":"500","clickElementSelector":".selector-wrapper:contains(\"Size\") select.single-option-selector option","clickType":"clickOnce","discardInitialElements":"discard-when-click-element-exists","clickElementUniquenessType":"uniqueCSSSelector"},{"id":"pre_result","type":"SelectorElementClick","parentSelectors":["results_size"],"selector":"_parent_","multiple":true,"delay":"500","clickElementSelector":".selector-wrapper:contains(\"Color\") select.single-option-selector option","clickType":"clickOnce","discardInitialElements":"discard-when-click-element-exists","clickElementUniquenessType":"uniqueCSSSelector"},{"id":"price","type":"SelectorText","parentSelectors":["pre_result"],"selector":"span.price-item--sale","multiple":false,"regex":"","delay":0},{"id":"chosen_size","type":"SelectorText","parentSelectors":["pre_result"],"selector":"select#SingleOptionSelector-0 option[selected]","multiple":false,"regex":"","delay":0},{"id":"chosen_color","type":"SelectorText","parentSelectors":["pre_result"],"selector":"select#SingleOptionSelector-1 option[selected]","multiple":false,"regex":"","delay":0}]}

1 Like

Thank you a lot, webber!