Selenium + Python: check attribute value Selenium + Python: check attribute value selenium selenium

Selenium + Python: check attribute value


If you want to check value of style attribute, try

if element.get_attribute('style') == 'display: block;':    validkey = True

or better to do it as below:

if element.value_of_css_property('display') == 'block':    validkey = True