find_element_by_android_uiautomator查找元素超时

困惑了两天的问题,原来是单引号和双引号问题,欠缺考虑到Java的格式

Traceback (most recent call last):
  File "D:/Python/PycharmProjects/ketang/test_s/test4.py", line 34, in <module>
    WebDriverWait(driver, 20).until(EC.visibility_of_element_located((MobileBy.ANDROID_UIAUTOMATOR, loc)))
  File "D:\Python\Python37\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: 

原代码:

find_element_by_android_uiautomator查找元素超时

更改后: 

loc = 'new UiSelector().text("已有账号?立即登录")'
WebDriverWait(driver, 20).until(EC.visibility_of_element_located((MobileBy.ANDROID_UIAUTOMATOR, loc)))
driver.find_element_by_android_uiautomator(loc).click()
find_element_by_android_uiautomator查找元素超时find_element_by_android_uiautomator查找元素超时 海染蓝 发布了6 篇原创文章 · 获赞 0 · 访问量 124 私信 关注
上一篇:数学推导+纯Python实现机器学习算法1:线性回归


下一篇:Selenium3种等待方式(二)(精述篇)