Trouble with dropdown

I can get the crawler to navigate the dropdown box through Element Click, but I can't get it to return the text from the selected option.

Url: https://rsfbathrooms.co.uk/shop/furniture/furniture-accessories/worktops/imperial-composite-work-tops-without-splash-back/

Sitemap:
{{"_id":"rsf-drop1","startUrl":["https://rsfbathrooms.co.uk/shop/furniture/furniture-accessories/worktops/imperial-composite-work-tops-without-splash-back/"],"selectors":[{"clickElementSelector":"td.value select option","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":2000,"discardInitialElements":"discard-when-click-element-exists","id":"product","multiple":true,"parentSelectors":["_root"],"selector":"div.site-content","type":"SelectorElementClick"},{"delay":0,"id":"option","multiple":false,"parentSelectors":["product"],"regex":"","selector":"td.value select option[selected]","type":"SelectorText"},{"delay":0,"id":"sku","multiple":false,"parentSelectors":["product"],"regex":"(?<=(SKU):\\s)(.*)","selector":".woocommerce-variation-sku b","type":"SelectorText"},{"delay":0,"id":"brand","multiple":false,"parentSelectors":["product"],"regex":"","selector":".woocommerce-product-attributes-item--attribute_pa_brand a","type":"SelectorText"},{"delay":0,"id":"range","multiple":false,"parentSelectors":["product"],"regex":"","selector":".woocommerce-product-attributes-item--attribute_pa_range a","type":"SelectorText"},{"delay":0,"id":"dimensions","multiple":false,"parentSelectors":["product"],"regex":"","selector":".woocommerce-product-attributes-item--dimensions td","type":"SelectorText"}]}

This can be done with the :checked selector.

{"_id":"rsfbathrooms-demo","startUrl":["https://rsfbathrooms.co.uk/shop/furniture/furniture-accessories/worktops/imperial-composite-work-tops-without-splash-back/"],"selectors":[{"id":"Title","multiple":false,"parentSelectors":["_root"],"regex":"","selector":"h1","type":"SelectorText"},{"clickElementSelector":"select#choose-a-colour-worktop option:not(\":contains('Choose an option')\")","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","delay":1500,"discardInitialElements":"discard-when-click-element-exists","id":"Click colours","multiple":true,"parentSelectors":["_root"],"selector":"form.variations_form","type":"SelectorElementClick"},{"id":"Colour","multiple":false,"parentSelectors":["Click colours"],"regex":"","selector":"select#choose-a-colour-worktop option:checked","type":"SelectorText"},{"id":"Price","multiple":false,"parentSelectors":["Click colours"],"regex":"","selector":"div>span.price","type":"SelectorText"},{"id":"SKU","multiple":false,"parentSelectors":["Click colours"],"regex":"","selector":".woocommerce-variation-sku","type":"SelectorText"}]}

That one works thanks!

The only problem is that the site changes the name of that dropdown box over different products. Is there anyway to make it look for the 1st dropdown box it can find, without naming the specific one?

OK change the Click selector to:
td.value > select:first-of-type option:not(":contains('Choose an option')")

and change Colour selector to:
td.value > select:first-of-type option:checked

1 Like

That worked great thanks. I'm now looking at a page that has two dropdown boxes on the same site and it keeps failing at the second dropdown.

{"_id":"rsf-drop-2","startUrl":["https://rsfbathrooms.co.uk/shop/furniture/furniture-units/tall-storage-cabinets/brioso-tall-cabinet-520w-x-240d/"],"selectors":[{"clickElementSelector":"td.value > select:first-of-type option:not(\":contains('Choose an option')\")","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":2000,"discardInitialElements":"discard-when-click-element-exists","id":"1st-drop","multiple":true,"parentSelectors":["_root"],"selector":"div.site-content","type":"SelectorElementClick"},{"delay":0,"id":"1st-drop-name","multiple":false,"parentSelectors":["2nd-drop"],"regex":"","selector":"td.value > select:first-of-type option:checked","type":"SelectorText"},{"clickElementSelector":"td.value > select:nth-of-type(2) option:not(\":contains('Choose an option')\")","clickElementUniquenessType":"uniqueCSSSelector","clickType":"clickOnce","delay":2000,"discardInitialElements":"discard-when-click-element-exists","id":"2nd-drop","multiple":true,"parentSelectors":["1st-drop"],"selector":"div.site-content","type":"SelectorElementClick"},{"delay":0,"id":"2nd-drop-name","multiple":false,"parentSelectors":["2nd-drop"],"regex":"","selector":"td.value > select:nth-of-type(2) option:checked","type":"SelectorText"}]}