This method uses JavaScript to get the value of an attribute.
498983
def get_attribute(self, selector, attribute, by=By.CSS_SELECTOR,
                      timeout=settings.SMALL_TIMEOUT):
        
        if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT:
            timeout = self.__get_new_timeout(timeout)
        if page_utils.is_xpath_selector(selector):
            by = By.XPATH
        if page_utils.is_link_text_selector(selector):
            selector = page_utils.get_link_text_from_selector(selector)
            by = By.LINK_TEXT
        self.wait_for_ready_state_complete()
        time.sleep(0.01)
        element = page_actions.wait_for_element_present(
            self.driver, selector, by, timeout)
        try:
            attribute_value = element.get_attribute(attribute)
        except (StaleElementReferenceException, ENI_Exception):
            self.wait_for_ready_state_complete()
            time.sleep(0.06)
            element = page_actions.wait_for_element_present(
                self.driver, selector, by, timeout)
            attribute_value = element.get_attribute(attribute)
        if attribute_value is not None:
            return attribute_value
        else:
            raise Exception("Element {%s} has no attribute {%s}!" % (
                selector, attribute))
776593
public String getAttributeValue(final String name) {
        final List<Attribute> attributes = Collections.synchronizedList(getAttributes());
        for (int i = 0; i < attributes.size(); i++) {
            final Attribute a = attributes.get(i);

            if (a.getName() != null && a.getName().equals(name)) {
                return a.getValue();
            }
        }
        return null;
    }
755985
public String getAttribute(String attributeName, String defaultValue)
	{
        String result = defaultValue;
        if (m_attributeList!=null)
        {
            result = (String)m_attributeList.get(attributeName);
            if (result==null)
            {
                result = defaultValue;
            }
        }
        return result;
	}
667100
protected String getElementAttribute(Element element, String attrName)
    {
        Attr attr = element.getAttributeNode(attrName);
        return attr != null ? attr.getValue() : null;
    }
69364
public String getValue(String name)
  {
    Attr attr = ((Attr) m_attrs.getNamedItem(name));
    return (null != attr) 
          ? attr.getValue() : null;
  }
518945
@Api
	public void getValue(String name, CurrencyAttribute attribute) {
		attribute.setValue((String) formWidget.getValue(name));
	}
55079
function getNameAttributeValue(element) {
	for (let i = 0, len = element.attributes.length; i < len; i++) {
		let attribute = element.attributes[i]

		if (attribute.name === 'name') {
			if (attribute.type !== 'attribute-simple') {
				throw new Error(`name attribute for ${element.name} tag must be a literal value`)
			}
			return attribute.value
		}
	}

	return ''
}
1219301
public int getValue(String attributeName, int defaultValue) {
        A attribute = getAt(attributeName);
        Object attributeValue = (attribute == null) ? null : attribute.getValue();
        return (attributeValue == null) ? defaultValue : Integer.parseInt(attributeValue.toString());
    }
545895
function(value) {
      
      if (value === "text") {
        value = this.text().trim();
        
      } else if (value === "html") {
        value = this.html().trim();
        
      } else if (value === "val") {
        value = this.val();
      
      } else if (value.indexOf("attr:") === 0) {
        value = this.attr(value.substr(5));
      }
      
      return value;
    }
1166554
@Api
	public void getValue(String name, UrlAttribute attribute) {
		attribute.setValue((String) formWidget.getItem(name).getValue());
	}
1369845
@Override
	public Attribute getAttribute(int index) {
		Attribute attribute = attributes.get(index - 1);
		return attribute;
	}
45696
public Attribute getAttribute(String name)
  {
    ArrayList<Attribute> attributeList = getAttributeList();
    
    for (int i = attributeList.size() - 1; i >= 0; i--) {
      Attribute attr = attributeList.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
825267
def getAttribute(self, attrName, defaultValue=None):
        '''
            
        '''

        if attrName in TAG_ITEM_BINARY_ATTRIBUTES:
            if attrName in self._attributes:
                attrVal = self._attributes[attrName]
                if not attrVal:
                    return True # Empty valued binary attribute

                return attrVal # optionally-valued binary attribute
            else:
                return False
        else:
            return self._attributes.get(attrName, defaultValue)
890076
public Attribute getAttribute(String name)
  {
    for (int i = _attributes.size() - 1; i >= 0; i--) {
      Attribute attr = _attributes.get(i);

      if (attr.getName().equals(name))
        return attr;
    }

    return null;
  }
732240
public Elements getElementsByAttributeValue(String key, String value) {
        return Collector.collect(new Evaluator.AttributeWithValue(key, value), this);
    }
188177
protected String getJavaScriptAttribute(String name)
    {
        AbstractHtmlState tsh = getState();
        return tsh.getAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, name);
    }
1361001
def get(self, attr, default=None):
        """"""

        attrs = self.body.get('attributes') or {}
        return attrs.get(attr, default)