I need to select an element from a drop-down menu.
For example:
<select id="fruits01" class="select" name="fruits">
<option value="0">Choose your fruits:</option>
<option value="1">Banana</option>
<option value="2">Mango</option>
</select>
1) First I have to click on it. I do this:
inputElementFruits = driver.find_element_by_xpath("//select[id='fruits']").click()
2) After that I have to select the good element, lets say Mango
.
I tried to do it with inputElementFruits.send_keys(...)
but it did not work.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…