Trying to get the innerhtml with javascript I do:
- Tried using function GetHTML() as explained by Pieter Scheldeman: but his results in unreadable code (UTF8?)
- I found:
https://stackoverflow.com/questions/7394748/whats-the-right-way-to-decode-a-string-that-has-special-html-entities-in-it (to get readable code) - Tried:
procedure TForm1.GetHtmlDemo;
begin
AdvWebBrowser1.ExecuteJavascript('function decodeHtml() {var txt = document.createElement("textarea"); txt.innerHTML = html; return txt.value;} decodeHtml();',
//This works but gives UTF8
//AdvWebBrowser1.ExecuteJavascript('function GetHTML(){return document.documentElement.innerHTML;} GetHTML();',
procedure(const AValue: string)
begin
memo1.Lines.Text:= AValue;
end
);
end;
But that does not work.
- How to debug this ?
- What's wrong ?
- Is there a :
- demo ?
- more elaborate manual for tadvWebbrowser
- collection of snippets ? (would be very helpful)
- a repository ?
Further to share:
I made the mistake of
- mixing Lowercase and Uppercase in Javascript
- breaking up the javascript as Delphicode: The Javascript is a string so use 'this'+'that'
Thanks for Help