问题遇到的现象和发生背景
<dl>
<dd status="-1">全部:<span id="allCount">27587</span></dd>
<dd class="active" status="1">待批阅:<span id="unCheckCount">141</span></dd>
<dd status="2">已完成:<span id="finishCount">25830</span></dd>
<dd status="0">未提交:<span id="unSubmitCount">953</span></dd>
<dd status="3">低于60分:<span id="reDoCount">663</span></dd>
</dl>
进入页面是初始状态为
想求换到“已完成”但是总是定位不上
问题相关代码,请勿粘贴截图
button9 = brower.find_element(By.XPATH, '/html/body/div[2]/div[2]/dl[2]/dd[3]') # 点击已完成作业按钮
button9.click()
运行结果及报错内容
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div[2]/dl[2]/dd[3]"}