HTML_GetElement Function

Description:

The HTML_GetElement function return an HTML tag content. 
The tag location can be specified by:

Format:

HTTP GET HOST Hostname URL url szVar = HTML_GetElement(options, tag, tagIndex);
HTTP GET HOST Hostname URL url szVar = HTML_GetElement(options, path);
szVar = HTML_GetElement(inputHtml, tag, tagIndex);
szVar = HTML_GetElement(inputHtml, path);

Parameters:

szVar

A string variable into which the tag content will be loaded.

options

Available options are:

CONTENT  The function is applied on the current HTTP response 

tag

A string expression containing the name of the HTML tag (without '<' and '>') to be retrieved.

tagindex

An integer expression containing the HTML tag index in the HTML document.

path

A string expression containing the path of the HTML tag (tag(tagnum){/tag(tagnum)}).

inputHtml

A string expression containing HTML from which the function will extract a specified tag.

Example:

STRING szVar;
STRING szHTML;

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szVar = HTML_GetElement(content, "SPAN", 2);
HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szVar = HTML_GetElement(content, "HTML(1)/BODY(1)/TABLE(1)/TR(3)/TD(2)/TABLE(1)/TR(2)/TD(1)/SPAN(1)");

HTTP GET HOST "demo.fmstocks.com" URL "/fmstocks/home.asp" szHTML = GetContent();
szVar = HTML_GetElement(szHTML, "SPAN", 2);
szVar = HTML_GetElement(szHTML, "HTML(1)/BODY(1)/TABLE(1)/TR(3)/TD(2)/TABLE(1)/TR(2)/TD(1)/SPAN(1)");

See also:





Go back to the Learning center:


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