def get_element_by_id(element_id, page):
    """
    Returns the element from the specified page tree (DFS search)
    """
    stack = []
    stack.append(page)

    while len(stack) > 0:
        top_element = stack.pop()
        if top_element is not None:
            if top_element["id"] == element_id:
                return top_element
            else:
                if "children" in top_element:
                    for child in top_element["children"]:
                        stack.append(child)