Parses the HTML content for sLeftBoundary and sRightBoundary and stores the string between these boundaries in sResult. If the right delimiter (sRightBoundary) is not specified (set to NULL), the string after sLeftBoundary with length nMaxResultLen is returned. If the left delimiter (sLeftBoundary) is not specified (set to NULL), the string from beginning to the right delimiter with a maximum length of nMaxResultLen is returned. If both boundary search strings are omitted (sLeftBoundary and sRightBoundary are set to NULL), all data with maximum length is stored into sResult. If the nMaxResultLen is set to STRING_COMPLETE an unlimited amount of data is stored in the sResult parameter.
It is important to know that all parsing and verification functions must be specified before the Web API call for which the response data should be parsed/verified. You can specify multiple parse/verification functions before a Web API call. The order of the parse/verification functions is not relevant (Exception: WebParseDataBound and WebVerifyDataBound using the flag WEB_FLAG_SYNCHRON).
When verifying/parsing an HTML page that consists of multiple frames, you can specify which frame document to verify/parse by specifying the sFrame parameter. By default, all HTML documents of the HTML page are scanned. This applies to HTML pages that are retrieved through a page-level command like WebPageUrl or WebPageLink.
WebAPI.bdh
WebParseHtmlBound( out sResult : string, in nMaxResultLen : number optional, in sLeftBoundary : string optional, in sRightBoundary : string optional, in nOptions : number optional, in sFrame : string optional, out nBytesParsed : number optional );
none
Parameter | Description |
---|---|
sResult | String variable that receives the string between the specified boundary strings. |
nMaxResultLen | Maximum length of the string to return (optional). If this parameter is omitted or set to STRING_COMPLETE all available data is stored in sResult. |
sLeftBoundary | Left boundary of the HTML content to compare. |
sRightBoundary | Right boundary of the HTML content to compare. |
nOptions |
Parsing options (optional). If this flag is omitted, none of the listed options are applied, meaning that the string comparison is case-insensitive, white spaces are not ignored, etc.
|
sFrame | Frame that gets searched for the content string (optional). If this parameter is omitted the whole page is scanned. |
nBytesParsed | Variable receiving the number of the bytes that are actually parsed (optional). |
dcltrans transaction TMain var nResult : number; sResult : string; begin WebParseHtmlBound(sResult, STRING_COMPLETE, "Begin", "X.X"); WebPageUrl("http://mycompany.com/"); Print(sResult); WebParseHtmlBound(sResult, STRING_COMPLETE, "Begin", "X.X", WEB_FLAG_IGNORE_WHITE_SPACE, "FrameA", nResult); WebUrl("http://mycompany.com/Shop/default.htm"); Print(sResult); Print(string(nResult) + "Bytes parsed"); end TMain;