概述
items = driver.find_elements_by_tag_name("a") print items for item in items: href = item.get_attribute('href') print href
它设法获取所有链接,但在get_attribute上我收到一个错误:
‘WebElement’对象没有属性’Get_Attribute’
虽然我看到的任何地方似乎都应该有效.
有解决方案吗
谢谢!
items = driver.find_elements_by_tag_name("a") print items for item in items: href = item.get_attribute('href') print href
总结
以上是编程之家为你收集整理的python – Selenium’WebElement’对象没有属性’Get_Attribute’全部内容,希望文章能够帮你解决python – Selenium’WebElement’对象没有属性’Get_Attribute’所遇到的程序开发问题。
如果您也喜欢它,动动您的小指点个赞吧