获取两个 h3 标签之间的所有 ul 元素
Get all ul elements in between two h3 tags
元素在页面上的样子如下:
计划和课程是 h3 标签。我想要 between 计划和课程中的所有 ul 标签。遵循 XPath 后,所有 ul 都出现在 Programs:
之后
"//h3[.='Programs']/following::ul"
我如何过滤它以获得唯一的 ul 介于课程和计划之间。
截图来源:https://catalog.fullerton.edu/preview_entity.php?catoid=16&ent_oid=1837&returnto=1920
尝试以下 XPath 以获得所需的 ul
节点:
//h3[.='Programs']/following-sibling::ul[following-sibling::h3[.='Courses']]
元素在页面上的样子如下:
计划和课程是 h3 标签。我想要 between 计划和课程中的所有 ul 标签。遵循 XPath 后,所有 ul 都出现在 Programs:
之后"//h3[.='Programs']/following::ul"
我如何过滤它以获得唯一的 ul 介于课程和计划之间。
截图来源:https://catalog.fullerton.edu/preview_entity.php?catoid=16&ent_oid=1837&returnto=1920
尝试以下 XPath 以获得所需的 ul
节点:
//h3[.='Programs']/following-sibling::ul[following-sibling::h3[.='Courses']]