Reputation: 41
How can i get text / html from a webpage on Firemonkey platform (Android/iOS). TWebBrowser Doesn't have anything for this...
Upvotes: 4
Views: 3926
Reputation: 48
This is a way I use to get html text
function GetURL(const AURL: string): string;
var
HttpClient: THttpClient;
HttpResponse: IHttpResponse;
begin
HttpClient := THTTPClient.Create;
try
HttpResponse := HttpClient.Get(AURL);
// memo1.Text:=HttpResponse.ContentAsString();
Result := HttpResponse.ContentAsString();
finally
HttpClient.Free;
end;
end;
Upvotes: 0
Reputation: 582
With some test, I combine JAVAScript and Delphi code, there is a workground, please refer to my article: http://firemonkeylessons.blogspot.tw/2015/01/get-htmljson-from-twebbrowser.html
Upvotes: 3