Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 11.4   11.5   12.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1    Statistic    FMM    Blog  

WebView.GetHTMLText

Queries the current HTML of the document.

Component Version macOS Windows Linux Server iOS SDK
WebView 2.8 ✅ Yes ✅ Yes ❌ No ❌ No ✅ Yes
MBS( "WebView.GetHTMLText"; WebViewerRef )   More

Parameters

Parameter Description Example
WebViewerRef Either the Web Viewer Object Name or the Web Viewer ID as returned by "WebView.FindByName" function.

Result

Returns html code as text or error.

Description

Queries the current HTML of the document.
This is not the HTML code loaded from the server, but the current state.
Typically the website is modified with Javascript to add widgets or hide/show things at runtime.
For websites with frames, result may only contain the main frame and not any child frames.

See also WebView.GetPlainText, WebView.GetFormattedText and WebView.SelectedText.
Alternative you can run JavaScript to query document.body.parentElement.outerHTML yourself.

Examples

Query plain text from WebViewer:

MBS("WebView.GetPlainText"; "web")

Query html text from WebViewer:

MBS("WebView.GetHTMLText"; "web")

Query formatted text from WebViewer:

MBS("WebView.GetFormattedText"; "web")

Query selected text:

MBS("WebView.SelectedText"; "web")

See also

Release notes

Example Databases

Blog Entries

This function checks for a paid license.

Created 18th August 2014, last changed 4th November 2021


WebView.GetFormattedText - WebView.GetHidden

💬 Ask a question or report a problem


Start Chat