xpath for selecting <option> html tag?
nokogiri, xpath
Solution
Several options here:
- `/html/body/form/select/option`
- `/html/body/form/select/option[1]`
- `/html/body/form/select/option[position() = 1]`
- `/html/body/form/select/option[@value='first option']`
All these lead to first option element
Problem
xpath for selecting html tag ? ``` <select> <option value="first option"> 1 </option> <option value="second option"> 2 </option> <option value="third option"> 3 </option> </select> ``` Would below suffice ? ``` html/body/form/select[@name='options' and @value='first option'] ```