user3376405
user3376405

Reputation: 41

Firemonkey Delphi TWebBrowser Get Text / HTML

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

Answers (2)

Winston
Winston

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

Dennies Chang
Dennies Chang

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

Related Questions