如何使用SeleniumPythonAPI从弹出窗口中的以下块中提取列表['Cat1','Cat2',Cat3']。在
...
<div class="categoryPopup" id="categoryPopup">
<div class="categoriesList"><li id="addCategory_231329891" class="edit_form_add_category">
<input id="checkCategory_231329891" class="fl" type="checkbox"><label for="checkCategory_231329891"><span class="title fl">Cat1</span></label>
<div class="cb"></div>
</li><div class="cb"></div><li id="addCategory_231329901" class="edit_form_add_category">
<input id="checkCategory_231329901" class="fl" type="checkbox"><label for="checkCategory_231329901"><span class="title fl">Cat2</span></label>
<div class="cb"></div>
</li><div class="cb"></div><li id="addCategory_231330011" class="edit_form_add_category">
<input id="checkCategory_231330011" class="fl" type="checkbox"><label for="checkCategory_231330011"><span class="title fl">Cat3</span></label>
<div class="cb"></div>
</div>
...
尝试使用以下代码无效:
^{pr2}$
尝试使用cssSelector,如下所示。我假设你想选中所有的复选框。以下代码将返回输入列表。您还应该使用
_elements_
来查找元素的集合。请参阅api文档。在相关问题 更多 >
编程相关推荐