Xpath高级定位技巧

372 阅读1分钟

Xpath定位:www.runoob.com/xpath/xpath…

1、滑动定位查找某个元素:

self.driver.find_element_by_android_uiautomator('new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().text("北京市").instance(0));')

2、向上查找父节点,每个/..都代表一层父节点

//*[@text='发动态']/../../../..