Get HTML Source of WebElement in Selenium WebDriver using Python

后端 未结 14 1904
误落风尘
误落风尘 2020-11-22 13:45

I\'m using the Python bindings to run Selenium WebDriver:

from selenium import webdriver
wd = webdriver.Firefox()

I know I can grab a webel

14条回答
  •  迷失自我
    2020-11-22 14:27

    Using the attribute method is, in fact, easier and more straight forward.

    Using Ruby with the Selenium and PageObject gems, to get the class associated with a certain element, the line would be element.attribute(Class).

    The same concept applies if you wanted to get other attributes tied to the element. For example, if I wanted the String of an element, element.attribute(String).

提交回复
热议问题