使用来自 jqueryui.com 的 iFrame 构建 xpath

Build xpath with iFrame from jqueryui.com

我在 https://jqueryui.com/selectmenu/ 网站上尝试为第一个选择器 Select a speed 构建 xpath。我构建了 iframe 的 xpath 但如何到达第一个选择器 Select a speed?

//body/div[@id='container']/div[@id='content-wrapper']/div[1]/div[1]/iframe[1]

由于您的元素位于 iframe 内,为了访问这些元素,您应该首先按照 here
所述切换到 iframe 此外,要找到 iframe,您只需使用 xpaths//iframe//iframe[@class='demo-frame'] 或 select by class [=16] 之一=]等
切换到 ifamexpath 到 select 速度是 //span[@id='speed-button']