code: def get_attribute(self, locator, attribute, params=None, timeout=None, visible=False):
          
          element = locator
          if not isinstance(element, WebElement):
              element = self.get_present_element(locator, params, timeout, visible)
  
          try:
              return element.get_attribute(attribute)
          except AttributeError:
              msg = "Element with attribute <{}> was never located!".format(attribute)
              raise NoSuchElementException(msg)
docs: Get attribute from element based on locator with optional parameters.
  
          Calls get_element() with expected condition: visibility of element located
  
          :param locator: locator tuple or WebElement instance
          :param attribute: attribute to return
          :param params: (optional) locator parameters
          :param timeout: (optional) time to wait for text (default: None)
          :param visible: should element be visible before getting text (default: False)
          :return: element attribute