我正在尝试验证文本。尝试了以下xpath,但它仍然显示无法识别元素错误。无法识别Se中的元素
//*[@id='bodyPartList_1']/li[1]/div
//div[@id='question_1_5' and contains(@span,'Does the patient weigh over 350lbs?')]
的元素HTML源:
<div id="question_1_5" class="qaContainer">
<input type="hidden" name="questionIds[]" value="5"/>
<div class="left" style="width: 680px;">
<span class="num">1.</span>
<span class="ans" style="width: 650px;">
Does the patient weigh over 350lbs?</span>
</div>
你能粘贴代码和堆栈跟踪? – Amith
请显示与您的XPath相匹配的HTML代码(其中'bodyPartList_1'和'li'?),还会显示您的堆栈跟踪和完整的异常消息。顺便说一句,你的第二个XPath是不正确的。 –
文字'病人体重超过350磅吗?'是的孩子。同样在你的HTML源代码中,''div class =“left”style =“width:680px;”>'没有关闭。请发布正确的HTML。 –