value_of_css_property(property_name)
returns value for a particular property.
But I want know if there is any way we can get all the css properties?
Try below to get property names:
element = driver.find_element_by_tag_name('a')
properties = driver.execute_script('return window.getComputedStyle(arguments[0], null);', element)
or to get all values of properties
element = driver.find_element_by_tag_name('a')
properties = driver.execute_script('return window.getComputedStyle(arguments[0], null);', element)
for property in properties:
print(element.value_of_css_property(property))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With