我使用的是pythonselenium,需要访问标签为“thisis2ndID”的元素并启用复选框?在
<h3 class="activator"> … </h3>
<div class="accordion-panel">
<ul>
<li class="field">
<input id="thisis1stID" type="checkbox" name=""></input>
<label for="thisis1stID"> … </label>
</li>
<li class="field">
<input id="thisis2ndID" type="checkbox" name=""></input>
<label for="thisis2ndID"> … </label>
</li>
<li class="field">
<input id="thisis3rdID" type="checkbox" name=""></input>
<label for="thisis3rdID"> … </label>
</li
尝试过这些,但似乎不起作用。。。在
^{pr2}$有什么想法吗?在
我用了几种不同的方法来完成这项工作,但是在您的例子中,最好的方法是迭代所有的
li
标记并搜索您要查找的id
值,试试这个如果在python中有使用cssSelector查找元素的规定,那么下面的选择器和click()事件将启用复选框。。。。在
我只研究过java,所以不能用python提供精确的代码。。在
you can click here to know more about different kind of selectors
这起作用了…很抱歉,需要点击激活器来加载子选项。。。在
相关问题 更多 >
编程相关推荐