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