Go back

How to: Iterate through two or more item variation selects

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-product-with-multiple-variations","startUrl":["https://webscraper.io/test-sites/e-commerce/allinone/product/495"],"selectors":[{"id":"product-wrapper-one","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"body","multiple":true,"delay":"500","clickElementSelector":"div.dropdown select option:not(:contains(\"Select color\""))""

Was this page helpful?