I know that I can use WebExecute
to retrieve WebElementObject
text, as in this example:
StartWebSession["Chrome"]
WebExecute["OpenPage"->"https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_population"]
table = First@WebExecute["LocateElements"->"XPath"->"//*[@id=\"mw-content-text\"]/div/table"]
WebExecute["ElementText"->table]
And that I can retrieve the complete page HTML:
html = WebExecute["JavascriptExecute"->"return document.documentElement.outerHTML;"]
The question is: How can I get WebElementObject
table data as HTML instead of text?
I explored some WebUnit
functions, but without success.
COMPLEMENT
You can convert your HTML to data using:
ImportString[getAttribute[table, "innerHTML"], {"HTML", "Data"}]