如何使用Selenium(Python)選擇下拉菜單選項(xiàng)值我需要從跌落菜單。例如:<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)首先,我必須點(diǎn)擊它。我這樣做:inputElementFruits = driver.find_element_by_xpath("//select[id='fruits']").click()2)在那之后,我必須選擇好的元素,讓我們說(shuō)Mango.我試著用inputElementFruits.send_keys(...)但沒(méi)有用。
請(qǐng)問(wèn)如何使用Selenium(Python)選擇下拉菜單選項(xiàng)值
三國(guó)紛爭(zhēng)
2019-08-02 14:02:36