Helper function: parse attribute data from a wiki html doc

    Args:
        doc (document parsed with lxml.html): parsed wiki page

    Returns:
        dict: attributes values and listed links, format ``{<key>: {'value': <value>, 'link': <link>}}``;
              only the first hyperlink listed in each attribute value is included

def get_attribute_data(doc):
    """Helper function: parse attribute data from a wiki html doc

    Args:
        doc (document parsed with lxml.html): parsed wiki page

    Returns:
        dict: attributes values and listed links, format ``{<key>: {'value': <value>, 'link': <link>}}``;
              only the first hyperlink listed in each attribute value is included
    """
    attributes = dict()
    for attribute_node in doc.xpath("//div[contains(@class, 'pi-data ')]"):
        # label node
        node = attribute_node.xpath(".//*[contains(@class, 'pi-data-label')]")[0]
        label = " ".join(node.itertext()).strip()

        # value node
        node = attribute_node.xpath(".//*[contains(@class, 'pi-data-value')]")[0]

        # get value, first link, and the link text
        value = " ".join(node.itertext()).strip()
        link_node = node.find('a')
        if link_node is not None:
            link = link_node.get('href')
            link_text = link_node.text
        else:
            link = None
            link_text = None

        # store result
        attributes[label] = dict(value=value,
                                 link=link,
                                 link_text=link_text)

    return attributes