CaptureHTML

Capture function, Web function.

The CaptureHTML function captures the text of the specified HTML element within a Web page.

Usage

Used for retrieving data from a Web page and paste them into another application. A Capture wizard is available in Start/Capture wizard menu. For retrieving data organized in Table, use CaptureTableHTML. A step by step capture process is available at Web how to capture data.

Syntax

ret=CaptureHTML(<html_descriptor>,var$)

Parameters

<html_descriptor>, unique identifier for the block-level HTML element from which the inner text is captured. See HTML descriptor for HTML tags identification. Spy can be used for generating automatically the HTML descriptor. Only HTML descriptors using CONTENT keyword are valid for the CaptureHTML function.

<var$>, string, captured text.

Return value

Ret, numeric return code. When successful, the function returns 0, otherwise use this return code for Error Handling.

Remarks

Here is the list of HTML block-level text tags which can be captured using the CaptureHTML function:

<address>, <blockquote>, <dd>, <div>, <dl>, <dt>, <h1> through <h6>, <li>, <ol>, <p>, <ul>.

Use the Capture wizard (menu Start/Capture wizard) or use Spy for generating automatically this statement.

CaptureHTML does not include any synchronization; a UsePage must be used before to be sure that the object to capture is ready.

See also

CaptureTableHTML

GetHTMLEditText

Example

 

StartBrowser("IE","www.wintask.com")

UsePage("WinTask - Automation software and Task Scheduler. Macro software with Macro Recorder")
ret = CaptureHTML("LI[CONTENT='Eliminating']", var$)
Msgbox(var$)

CloseBrowser()