How to get an attribute of an element in Selenium

You can use the getAttribute() method to get an attribute.

Java

element.getAttribute("attributeName")

Python

element.get_attribute("attributeName")

C#

element.GetAttribute("attributeName");