0
我想通過點擊選項中選擇菜單選項,找到表單元素:硒不能與XPath
driver.implicitly_wait(30)
driver.find_element_by_xpath("//select[option/@value='today']").click()
,但它不工作(無打印到終端)
的HTML如下:
<select tabindex="0" class="itc_listBox mid"><option value="oneDay">1 Day</option><option value="sevenDays">7 Days</option><option value="fourteenDays">14 Days</option><option value="oneMonth">1 Month</option><option value="sixMonth">6 Months</option><option value="oneYear">1 Year</option><option value="" disabled="disabled">————————</option><option value="today">Today</option><option value="yesterday">Yesterday</option><option value="weekToDate">Week-to-Date</option><option value="last7Days">Last 7 Days</option><option value="lastWeek">Last Week</option><option value="monthToDate">Month-to-Date</option><option value="last30Days">Last 30 Days</option><option value="customDateRange">Custom </option></select>
我使用Firefox的webdriver的,我認爲是由JS生成的HTML