def find_itemprop()

in python/mhtml_to_json.py [0:0]


def find_itemprop(node, prop):
    if "itemprop" in node.keys():
        if prop in node.get("itemprop"):
            return node
    for child in node:
        value = find_itemprop(child, prop)
        if value is not None:
            return value
    return None