I don’t know how to retrieve a XML content from TWebBrowser ActiveX component using Delphi.
If the result is a HTML, I could use:
iall := (WebBrowser1.Document AS IHTMLDocument2).body;
while iall.parentElement <> nil do
begin
iall := iall.parentElement;
end;
memo1.Text := iall.outerHTML;
But the URL returns a XML file and .body returns nothing.
What is the missing part for the code below??
var S:String;
begin
WebBrowser1.Navigate('http://192.168.0.35:8000/api/');
if Assigned(WebBrowser1.Document) then
begin
Doc := (WebBrowser1.Document as IHTMLDocument2);
XMLText := ???
end;
end;
Remark: I could not use Indy HTTPClient component because the program will run on different proxies configurations and it will be difficult to deal with many configurations.
This seems to work for a local XML file, and should work with a URL as well: