HTML_GetTable Function

Description:

The HTML_GetTable function returns a two dimensions string array containing an HTML table.

Format:

HTTP GET HOST Hostname URL url arrayVar = HTML_GetTable(options, tableIndex);
arrayVar = HTML_GetTable(inputHtml, tableIndex);

Parameters:

arrayVar

A two dimensions array string variable into which the table will be loaded.

options

Available options are:

CONTENT  The function is applied on the current HTTP response 

tableIndex

An integer expression containing the table index in the HTML.

inputHtml

A string expression containing HTML from which the function will extract the table.

Example:

STRING arrayVar[][];
STRING szHTML;
INTEGER iNbValues;
INTEGER i;

// Retrieve first table in HTML page
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" arrayVar = HTML_GetTable(content, 1);

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szHTML = GetContent();
arrayVar = HTML_GetTable(szHTML, 1);

iNbValues = Bound(arrayVar, 1);
LOG "Nb rows = " + ToString(iNbValues);
iNbValues = Bound(arrayVar, 2);
LOG "Nb columns = " + ToString(iNbValues);

Output:

Nb rows = 4
Nb columns = 4

See also:





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap