Python selenium 获取标签内的text值的方法

driver.find_element_by_xpath("").get_attribute('textContent')

get_attribute这个方法还可以定位标签内是否含有某个属性

 

比如 ,看一下某个按钮是不是 disabled状态的

driver.find_element_by_xpath("").get_attribute('disabled')

posted @ 2021-09-07 17:34  小清澈  阅读(781)  评论(0编辑  收藏  举报