How to scrape value from option tag inside select?

I want to scrape all the options under the select element to scrape product variants available on the eCommerce website I am scraping

Example HTML

<select name="sizes">
<option value="S">Small</option>
<option value="M">Medium</option>
<option value="L">Large</option>
<option value="XL">Extra-Large</option>
</select>

I tried to use the “.sizes” selector and it’s not scraping anything. And I don’t want full text, instead the option value of the select item. Any help will be appreciated!

“sizes” is not a class, so you cannot use it with dot (.) to match this element. You should be using the attribute selector select[name="sizes"] option and value as your attribute to scrape all values.

Here is Github example to try out - https://agenty.github.io/Agenty.TestData/forum/forum-16.html

Thanks @vikash , it works now :+1: I was not aware with attribute selectors in Agenty.