def get_child(node, tag_name):
    """Analog of JS's node.getElementsByTagName(tag_name)[0].

    Args:
        node: parent node
        tag_name: tag name

    Returns:
        Returns first matching child element

    Raises:
        IndexError if unable to find the node
    """
    return [
        child
        for child in node.childNodes
        if child.nodeType != child.TEXT_NODE
           and child.tagName == tag_name
    ][0]