0
<th id="id1" class="LockedColumnForTable" nowrap="nowrap" index="1" level="1" path="db" name="db" style="padding:0;" isLeaf="true" n="Date"><div id="id2"><select name="name1" id="id3" style="display: none;">
<option value="38478">27-Mar-2014</option>
<option value="38388">26-Mar-2014</option>
</select></div></th>
這是web ui中下拉菜單的代碼。我需要選擇2014年3月26日。我正在使用蟒蛇硒。從隱藏元素的下拉列表中選擇
我寫的代碼
driver.execute_script("document.getElementById('id3').style.display='block'")
,但我得到JavaScript錯誤,當我運行的代碼。請告知我在這裏錯過了什麼。
看一看:http://stackoverflow.com/questions/7340680/selenium-how-can-i-make-webdriver-ignore-element-is-not-visible-error – alecxe