I have HTML emails from which I want to extract information. My emails are well-formed HTML. Normally, in other environments, to handle this, I would use an XML library’s HTML parse mode to get an XML DOM to look at it.
It looks like the xpath() and xml() functions exist. Those are pretty powerful and would provide the ability to access the data as using the XML DOM.
However, I cannot figure out how to parse HTML as XML. When I pass my HTML to xml(), I get the error “The provided value cannot be converted to XML: 'The 'meta' start tag on line 2 position 161 does not match the end tag of 'head'. Line 214, position 11.'. Please see https://aka.ms/logicexpressions#xml for usage details.'” This error makes sense and is how this should work. However, I cannot figure out how to get an XML object from HTML like I can in other libraries.
Is there any equivalent to an HTML DOM library with XPath support in power automate? Or something that can process HTML into XML similar to xmllint --html - or DOMDocument::loadHTML())?