Macro Scheduler 15

IEGetTags

IEGetTags>URL,Tagname,ReturnType,ArrayVar

 

This function will return an array of tag values for all tags of the given tag name in the IE window whose URL matches or contains the specified URL.

 

URL: The current URL of the IE window to extract from.  This can be a substring.  If using a substring and you have multiple IE windows open try to be unique to ensure a correct match.

 

Tagname: The name of the tags to extract.  E.g. "A", "INPUT" or "DIV".  This can be any tag type.

 

ReturnType: Use: "H" to return innerHTML (i.e. the HTML between the opening and closing tags); "O" to return outerHTML (includes the HTML in the tag itself) or "T" for innerText (the text that appears between the opening and closing tags).

 

ArrayVar: The variable name to store the results in.  ArrayVar_Count will contain the number of items returned.

 

This function can be used to extract data from web pages.  Use a loop and RegEx/EasyPatterns or similar to further identify specific elements.

 

Fore more control of Internet Explorer (navigating, waiting for documents to complete, file downloads, clicking, form filling and extracting) use the IEAuto library which comes with WebRecorder, an optional Macro Scheduler add-on.

 

See also: IETagEvent, IETagEventByAttrib, IEGetTagsByAttrib, IEWait

 

Example

 

//get all input tags from amazon

IEGetTags>amazon.co.uk,INPUT,O,tags

 

//find the search box (name=field-keywords)

Let>p=0

Let>k=0

While>p=0

  Let>k=k+1

  Let>tag=tags_%k%

  Pos>name=field-keywords,tag,1,p

EndWhile

 

//Enter a search term in it ...

IETagEvent>amazon.co.uk,INPUT,k,,Grisham

 

//Find the Go button 

Let>p=0

Let>k=0

While>p=0

  Let>k=k+1

  Let>tag=tags_%k%

  Pos>alt=Go,tag,1,p

EndWhile

 

//click it ...

IETagEvent>amazon.co.uk,INPUT,k,Click,