GetElements

Gets an array of elements in the active tab, satisfying the specified conditions

Syntax

function GetElements(aTagName:string='*'; aAttributes,aValues:array of string=[]; aStrong:boolean=false; aAntiAttributes,aAntiValues:array of string=[]; aAntiStrong:boolean=false):TCSElements;

Parameters

  • aTagName
    • type: string
    • functions: elements tag
  • aAttributes
    • type: array of string
    • functions: array of elements attributes
  • aValues
    • type: array of string
    • functions:array of attribute values ​​corresponding to the array of elements attributes
  • aStrong
    • type: boolean
    • functions: flag of match precision of the attribute values
  • aAntiAttributes
    • type: array of string
    • functions:array of exclusive attributes
  • aAntiValues
    • type: array of string
    • functions: array of values of exclusive attributes
  • aAntiStrong
    • type: boolean
    • functions: flag of match precision of the exclusive attribute values

Returned value

  • functions: structure containing parameters of the found elements array

Notes

  • When searching for elements script enumerates all the elements that have values ​​aValues of aAttributes ​​attributes . Of these elements, the script selects the elements that are not have value aAntiValues ​​of aAntiAttributes attributes. If aStrong flag is true, the elements are found, the values ​​ aValues ​​of aAttributes properties of which are strictly equal to the specified (sensitive search is not considered). Otherwise, elements will be found in aAttributes property values of ​​which include the appropriate values ​​aValues. Similarly, with the flag aAntiStrong.
  • If no elements are found, the fields of the resultant structure will be empty.
  • Found elements will be highlighted by a dotted frame

Examples

  1. //Loading page http://www.thetimes.co.uk/
    LoadURI('http://www.thetimes.co.uk/');
    //Get all elements with tag "a" (all links)
    var elements:=GetElements('a');