CopyLink
Web function.
The CopyLink function returns the link associated at the specified html element. Not available in WinTask Lite.
Usage
It's the same usage as a right click on a link and then in the context menu, the selection of Copy shortcut option.
Syntax
ret=CopyLink(<html_descriptor> ,result$)
Parameters
<html_descriptor>, unique identifier for the HTML element to look for its link.
result$, string, returns the link.
Return value
Ret, numeric return code. If the specified HTML element has been successfully found within 30 seconds (this default value can be changed using #ActionTimeout), the function returns 0. Otherwise use this return code for Error Handling.
List of negative error codes
-1
No browser in use (no previous UsePage or StartBrowser)
-3
Bad descriptor, invalid syntax
-4
The browser has been lost (for instance because of a Closewindow)
-5
Page not found
-8
Specified element not found
-11
Any other error
-404,405
Usual http error codes (requires IE 6 or above)
Remarks
CopyLink function returns the actual link which is behind a clickable link. It simulates a right click on the specified html element, and in the context menu takes the option Copy shortcut.
Examples
'On WinTask Demo website, retrieve the link behind Form link
StartBrowser("IE","www.wintask.com/demos")
UsePage("WinTask Demonstration Pages")
CopyLink("A[INNERTEXT= 'Form']",link$)
msgbox(link$)
'link$ contains http://www.wintask.com/demos/form.htm
CloseBrowser()
'Using Firefox
StartBrowser("FF","www.wintask.com/demos")
UsePage("WinTask Demonstration Pages")
CopyLink("A[INNERTEXT= 'Form']",link$)
msgbox(link$)
'link$ contains http://www.wintask.com/demos/form.htm
CloseBrowser()