How to Take Variant Option name

Describe the problem.
I am trying to scrape product page. But variant option name scraping all option while I need only selected one.

Please help me.

Sitemap:
{"_id":"My-scrape","startUrl":["https://www.visualcomfort.com/kean-14-sconce-chd2925/"],"selectors":[{"elementLimit":0,"id":"element","multiple":false,"parentSelectors":["_root"],"scroll":false,"selector":"div.page-wrapper","type":"SelectorElement"},{"id":"title","multiple":false,"multipleType":"singleColumn","parentSelectors":["element"],"regex":"","selector":"h1","type":"SelectorText"},{"id":"sku","multiple":false,"multipleType":"singleColumn","parentSelectors":["element"],"regex":"","selector":".product-info-main > div.product-info-price div[itemprop='sku']","type":"SelectorText"},{"id":"option 1","multiple":false,"multipleType":"singleColumn","parentSelectors":["element"],"regex":"","selector":"select","type":"SelectorText"}]}

Hi,

It looks like there is no preselected option when opening the page with a fresh browser session:

image

you can try this sitemap and make post-processing after scraping to clear your data:

{"_id":"My-scrape","startUrl":["https://www.visualcomfort.com/kean-14-sconce-chd2925/"],"selectors":[{"id":"title","multiple":false,"parentSelectors":["_root"],"regex":"","selector":"h1","type":"SelectorText"},{"extractAttribute":"data-clp-sku","id":"sku","parentSelectors":["_root"],"selector":".configurable-thumbnail","type":"SelectorGroup"},{"extractAttribute":"","id":"option","parentSelectors":["_root"],"selector":".super-attribute-select option:not(:contains(\"Choose an Option\"))","type":"SelectorGroup"},{"extractAttribute":"data-product-price","id":"price","parentSelectors":["_root"],"selector":".configurable-thumbnail","type":"SelectorGroup"}]}

Thanks a lot for the sitemap. I appreciate your effort. Is there have any way that I can take the option value id (Please see the attchement)

Below is a reference with 2 methods:

{"_id":"My-scrape2","startUrl":["https://www.visualcomfort.com/kean-14-sconce-chd2925/"],"selectors":[{"id":"title","multiple":false,"multipleType":"singleColumn","parentSelectors":["_root"],"regex":"","selector":"h1","type":"SelectorText"},{"extractAttribute":"data-clp-sku","id":"sku","parentSelectors":["_root"],"selector":".configurable-thumbnail","type":"SelectorGroup"},{"extractAttribute":"","id":"option","parentSelectors":["_root"],"selector":".super-attribute-select option:not(:contains(\"Choose an Option\"))","type":"SelectorGroup"},{"extractAttribute":"data-product-price","id":"price","parentSelectors":["_root"],"selector":".configurable-thumbnail","type":"SelectorGroup"},{"extractAttribute":"value","id":"option-id","multipleType":"singleColumnWithSeparator","parentSelectors":["_root"],"selector":"option:not(:contains('Choose an Option...'))","type":"SelectorElementAttribute"},{"elementLimit":0,"id":"option-wrapper","multiple":true,"parentSelectors":["_root"],"scroll":false,"selector":"\t.super-attribute-select option:not(:contains(\"Choose an Option\"))","type":"SelectorElement"},{"extractAttribute":"value","id":"option-id2","multiple":false,"multipleType":"singleColumn","parentSelectors":["option-wrapper"],"selector":"_parent_","type":"SelectorElementAttribute"}]}
1 Like

if you were told before, that you need these IDS, it would be mych quicker to complete!!! Easyyyy! )))