ExistHTMLElement
Web function.
The ExistHTMLElement function checks for the existence of the specified html element. Not available in WinTask Lite.
Usage
For advanced users, it allows to check first if an HTML element is there before trying to use it.
Syntax
ret=ExistHTMLElement(<html_descriptor>)
Parameters
<html_descriptor>, identifier of the HTML element to check within the current Web page specified by the last UsePage. Use Recording mode for generating automatically the html descriptor.
Return value
Ret, numeric return code. If the specified HTML element is found, the function returns 1, if not it returns 0. If there is no previous UsePage or StartBrowser line, the function returns 0.
Remarks
ExistHTMLELement function does not check if a UsePage has been done before, or if the element to test has finished to load. So always write a UsePage before using ExistHTMLElement: the UsePage makes the automatic synchronization and so the line after the UsePage will be executed only when all the elements on the page are loaded.
Example
Check if the html element WinTask is on the first page of the WinTask website.
StartBrowser("IE", "www.wintask.com")
ret=ExistHTMLElement("A[INNERTEXT= 'WinTask']")
msgbox(ret) 'returns 1
The function is case sensitive for the HTML descriptor unless you use #IgnoreHTMLCase = 1
StartBrowser("IE", "www.wintask.com")
ret=ExistHTMLElement("A[INNERTEXT= 'winTask']")
msgbox(ret) 'returns 0
but
StartBrowser("IE", "www.wintask.com")
#IgnoreHTMLCase=1
ret=ExistHTMLElement("A[INNERTEXT= 'winTask']")
msgbox(ret) 'returns 1