Parses the response data 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 (or after the last position of a previous search with) with maximum length 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. If nLeftOccurrence is greater than 1 (default is one) the sLeftBoundary has to be found nLeftOccurrence times, before the copy process starts and the right boundary is searched.
When verifying/parsing an HTML page that consists of multiple frames (HTML documents), you can specify which frame document to verify/parse by specifying the nDocNum parameter. By default (1) the top document (e.g. a frameset) is scanned. This applies to HTML pages that are retrieved through a page-level command like WebPageUrl or WebPageLink.
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).
WebAPI.bdh
WebParseDataBoundEx(out sResult : string, in nMaxResultLen : number optional, in sLeftBoundary : string optional, in nLeftOccurrence : number optional, in sRightBoundary : string optional, in nOptions : number optional, in nDocNum : number 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. |
nLeftOccurrence | The sLeftBoundary has to be found nLeftOccurrence times, before the copy process starts and the right boundary is searched (optional). The default value is one. Provide WEB_OCCURENCE_LAST to specify the last occurrence. |
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.
|
nDocNum | Specifies the document to parse (optional). Specify WEB_DOC_ALL if you want to parse all documents. If this parameter is omitted, the first document gets parsed. (see above definition FLAG_INCLUDE_EMBEDDED) |
nBytesParsed | Variable receiving the number of bytes actually parsed (optional). |
dcltrans transaction TMain var nResult: number; sFont: string; sResult: string; begin WebParseDataBoundEx(sResult, STRING_COMPLETE, "<table>", 2, "</table>"); WebPageUrl("http://mycompany.com/"); WebParseDataBoundEx(sFont, STRING_COMPLETE, "<font>", 6, "</font>", WEB_FLAG_CASE_SENSITIVE | WEB_FLAG_IGNORE_WHITE_SPACE); WebParseDataBoundEx(sResult, 200, "<b>Shop", 2, "&", WEB_FLAG_CASE_SENSITIVE, 2, nResult); WebUrl("http://mycompany.com/Shop/default.htm"); Print(sFont); Print(sResult); Print(string(nResult) + "Bytes parsed"); end TMain;