Go back

How to: Iterate through item drop-down variations

Description:

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.

Sitemap:

{"_id":"web-scraper-dropdown-variation","startUrl":["https://webscraper.io/test-sites/e-commerce/allinone/product/486"],"selectors":[{"id":"product-wrapper","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"body","multiple":true,"delay":"1000","clickElementSelector":"div.dropdown select option","clickType":"clickOnce","discardInitialElements":"do-not-discard","clickElementUniquenessType":"uniqueCSSSelector"},{"id":"price","type":"SelectorText","parentSelectors":["product-wrapper"],"selector":"h4.pull-right","multiple":false,"regex":"","delay":0},{"id":"color","type":"SelectorText","parentSelectors":["product-wrapper"],"selector":"div.dropdown select option[selected]","multiple":false,"regex":"","delay":0}]}

Was this page helpful?