获取text t1 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").text print(t1) 获取tag_name 就是class属性 t2 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").tag_name print(t2) content-desc为空,获取的是text t3 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").get_attribute("name") print(t3) 也可以这样写 # id t5 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").get_attribute("resourceId") print(t5) # class t6 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").get_attribute("className") print(t6) # text t7 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").get_attribute("text") print(t7) # size t10 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").size print t10 # location t11 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").location print t11 获取其他属性 checkable t8 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").get_attribute("checkable") print t8 # clickable t9 = driver.find_element_by_id("com.baidu.yuedu:id/lefttitle").get_attribute("clickable") print t9