页面上有轮播 隔几秒就会滚动 我通过绝对路径获取,每次都会提示:
selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters.

代码为:
# 轮播绝对路径
bannerPath='//XCUIElementTypeApplication[@name="XXX"]/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeScrollView/XCUIElementTypeOther[3]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeScrollView[2]/XCUIElementTypeOther[2]/XCUIElementTypeOther/XCUIElementTypeImage'
# 点击轮播
driver.driver.find_element_by_xpath(bannerPath)


↙↙↙阅读原文可查看相关链接,并与作者交流