GetContents Function (HtmlList)

Class

HtmlList.

Action

Returns the contents of all items in the list.

Availability

This functionality is supported only if you are using the Classic Agent.

Syntax

lsContents = list.GetContents( )
Variable Description
lsContents The contents of the entire list. LIST OF STRING.

Notes

The returned contents contain the full text for each list item as a single string within the list of strings; duplicate items are indexed. To get the full text of an item as a list of strings, use GetItemMultiText.

Nested lists are flattened, which means that the returned contents do not indicate nesting of lists.

Example 1

This example uses the list of used technologies in the About This Site page of the GMO Web application.

LIST OF STRING lsText
lsText = AboutPage.UsedList.GetContents()
ListPrint(lsText)

// Results:
// HTML 3.2
// HTML Browser Extensions
// Animation
// JavaScript
// CGI
// Java
// ActiveX
// Client-side processes
// Server-side processes

Example 2

This example uses the following HtmlList:

Flowers
Trees
  Oak
  Pine
  Elm
Birds
LIST OF STRING lsText
lsText = BrowserPage.HtmlList("#1").GetContents()
ListPrint(lsText)

// Result:
// Flowers
// Trees
// Oak
// Pine
// Elm
// Birds