我需要从下拉菜单中选择一个元素.
例如,打开这个:
<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>
Run Code Online (Sandbox Code Playgroud)
所以首先我要点击它.我这样做:
inputElementFruits = driver.find_element_by_xpath("//select[id='fruits']").click()
Run Code Online (Sandbox Code Playgroud)(好吧,打开菜单)
Mango
但它没有用.