def get_dom_tree(html, website):
    """Parses a HTML string to a DOMTree.

    We preprocess the html string and use lxml lib to get a tree structure object.

    Args:
      html: the string of the HTML document.
      website: the website name for dealing with special cases.

    Returns:
      A parsed DOMTree object using lxml library.
    """
    cleaner = Cleaner()
    cleaner.javascript = True
    cleaner.style = True
    cleaner.page_structure = False
    html = html.replace("\0", "")  # Delete NULL bytes.
    # Replace the <br> tags with a special token for post-processing the xpaths.
    html = html.replace("<br>", "--BRRB--")
    html = html.replace("<br/>", "--BRRB--")
    html = html.replace("<br />", "--BRRB--")
    html = html.replace("<BR>", "--BRRB--")
    html = html.replace("<BR/>", "--BRRB--")
    html = html.replace("<BR />", "--BRRB--")

    # A special case in this website, where the values are inside the comments.
    if website == "careerbuilder":
        html = html.replace("<!--<tr>", "<tr>")
        html = html.replace("<!-- <tr>", "<tr>")
        html = html.replace("<!--  <tr>", "<tr>")
        html = html.replace("<!--   <tr>", "<tr>")
        html = html.replace("</tr>-->", "</tr>")

    html = clean_format_str(html)
    x = lxml.html.fromstring(html)
    etree_root = cleaner.clean_html(x)
    dom_tree = etree.ElementTree(etree_root)
    return dom_tree
Parses a HTML string to a DOMTree.

    We preprocess the html string and use lxml lib to get a tree structure object.

    Args:
      html: the string of the HTML document.
      website: the website name for dealing with special cases.

    Returns:
      A parsed DOMTree object using lxml library.
    
markuplm/examples/fine_tuning/run_swde/prepare_data.py