DEV Community

Discussion on: Using Selenium with Rust

Collapse
 
stevepryde profile image
Steve Pryde

You can target them directly using xpath "option[text()='AK']" (or you can match on the value instead of the text if preferred).

It may be possible to just click the option directly but if not then just click the select element first then the option.

Alternatively the CSS selector can also work e.g. "option[value='AK']"

These questions are really general selenium questions not specific to thirtyfour or Rust. The same will apply using any selenium framework or library. As I mentioned some libraries do provide a wrapper for select elements specifically but it's just doing the above for you.