HTML functions

Functions in the html package

html.xpath

html.xpath(input: HTML, query: string) -> HTMLXPathResult

html.xpath allows you to query the contents of an HTML document (including the body of an email) using XPath syntax.

any(html.xpath(body.html, '//a/@href').nodes,
    strings.parse_url(.raw).domain.root_domain != 'example.com'
)
any(html.xpath(body.html, '//h1').nodes,
    regex.icontains(.display_text, 'Docu.?Sign')
)
any(
    html.xpath(ml.link_analysis(.).final_dom,
        '//a/@href'
    ).nodes,
    strings.parse_url(.raw).domain.tld in $suspicious_tlds
)