【问题标题】:Selenium WebElement List of AttributesSelenium WebElement 属性列表
【发布时间】:2021-08-17 12:53:35
【问题描述】:

尤其是在 Python 中,在找到 web 元素之后,我实际上并不知道它具有哪些属性。所以我不能高效地工作。
一个例子:

element = driver.find_element_by_class_name("someclass")
print(element.get_attrubite("class"))

InnerHTML、outerHTML、class、value 是我知道的一些属性。是否有我们可以获得的所有属性的列表?

【问题讨论】:

    标签: python selenium web webdriver


    【解决方案1】:

    在问题Selenium webdriver: How do I find ALL of an element's attributes? 中,您可以找到您要查找的内容。

    它提到使用命令 execute_script() 以及您的网络驱动程序。

    【讨论】:

    • 谢谢,但我知道另外两个属性,innerHTML 和outerHTML,我无法通过这些答案得到它们。还有其他共同的属性吗?
    猜你喜欢
    • 2015-05-02
    • 2016-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-21
    • 1970-01-01
    • 2020-11-18
    • 1970-01-01
    相关资源
    最近更新 更多