Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我遇到了 FirePath 的 问题
html/body/center/center[3]/form/table/tbody/tr[1]/td[2]/input
来自 FirePath 的 XPath。这是一条绝对路径。 但我需要一个相对路径。如何得到它?
更好的方法是编写自己的自定义相对 xpath。
还有另一种在 FirePath 工具的帮助下获取相对 xpath 的方法。要获得相对 XPATH:单击 Firepath 按钮上的下拉菜单并取消选择“生成绝对 XPath”。
然后你应该得到相对 XPATH(从生成的 XPATH 中删除“.”),如下所示: