How to:

Multiple variations

Description:

To prevent Web Scraper from clicking on the default option, combine ":not()" jQuery selector with ":contains()" jQuery selector containing the default text.
To prevent Web Scraper from clicking on unavailable options, find an attribute or class that is unique to them and include them in ":not()" jQuery selector.
Web Scraper adds "selected" attribute to option element that it clicked on so the selected value can be scraped by setting "option[selected]" CSS selector.
To iterate through more than two item variation selects, repeat the same steps as for "product-wrapper-two" and create data extraction selectors only for the last click selector.

Sitemap:

{"_id":"web-scraper-mutliple-variations","startUrl":["https://webscraper.io/test-sites/e-commerce/ajax/product/10"],"selectors":[{"clickActionType":"real","clickElementSelector":"select option","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":0,"discardInitialElements":"discard-when-click-element-exists","id":"dropdown-click","multiple":true,"parentSelectors":["_root"],"selector":"div.wrapper","type":"SelectorElementClick"},{"clickActionType":"real","clickElementSelector":"button","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":0,"discardInitialElements":"discard-when-click-element-exists","id":"button-click","multiple":true,"parentSelectors":["dropdown-click"],"selector":"_parent_","type":"SelectorElementClick"},{"id":"price","multiple":false,"parentSelectors":["button-click"],"regex":"","selector":"h4.price","type":"SelectorText"},{"id":"color","multiple":false,"parentSelectors":["button-click"],"regex":"","selector":"select option[selected]","type":"SelectorText"},{"id":"hdd","multiple":false,"parentSelectors":["button-click"],"regex":"","selector":"button.active","type":"SelectorText"}]}

Was this page helpful?