我在读取 XPath 时遇到问题。需要专家的帮助/建议。
我的部分 HTML 如下:
<div class = "input required_field">
<div class="rounded_corner_error">
<input id="FnameInput" class="ideField" type="text" value="" name="first_name>
<div class ="help-tooltip">LOGIN BACK TO MAIN</div>
<div class="error-tooltip">
我需要找到短信的 XPath (LOGIN BACK TO MAIN)
使用 Firebug 我找到了 XPath
("//html/body/div/div[5]/div/div/form/fieldset/div/div[2]/div[2]/div/div");
但是使用上面的 XPath 我只能阅读 class = help-tooltip
但我需要阅读 LOGIN BACK TO MAIN
。
最佳答案
尝试在您拥有的 xpath 末尾添加 /text()
。
关于html - 输入后在 div 中查找文本的 XPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16881356/