我想单击子菜单中的删除。
我尝试了下面的代码,但没有任何反应。
wd_handle.execute_script("document.getElementById('optionPanel').hidden=false;")
mouse.move_to_element(OptionPanel).perform()
WebDriverWait(wd_handle,10)
wd_handle.find_element_by_partial_link_text('Delete').click()
HTML 源代码:
<div id="optionPanel" style="height: auto; width: auto; left: 126px; top: 368px; display: none; overflow-y: hidden;">'
<div class="wrapper">
<ul aria-hidden="false" role="menu">
<li role="menuitem">
<li role="menuitem">
<li class="divider" role="menuitem">
<a class="optionPanelLink" tabindex="0"
href="#playlistManager/action=delete/selected=701f55af-c5f0-4f31-b34f-964f52be5fef/idx=0">
Delete</a>
</li>
</ul>
</div>
</div>
我必须单击 id = 7ba9b231-5fc4-448b-b41a-f236437c182cCount 的元素才能使上述元素可见。
<li class="playlist viewing">
<a id="7ba9b231-5fc4-448b-b41a-f236437c182cLink" class="ellipsis" title="TestList2" href="#playList/name=TestList2/list=7ba9b231-5fc4-448b-b41a-f236437c182c">TestList2</a>
<span class="entryCount">0</span>
<a id="7ba9b231-5fc4-448b-b41a-f236437c182cCount" class="customPlaylistSpriteLocation optionSprite" href="#option/playlist=TestList2/selected=7ba9b231-5fc4-448b-b41a-f236437c182c/idx=0"></a>
</li>