Skip to main content


Command Description

Use a browser to download files from a specified link

Command Prototype


Parameter Description

hWebTrueexpressionhWebBrowser handle string using WebBrowser.create or WebBrowser.bind Command Returns
sURLTruestring""The link address (URL) to download file
sFileTruepath'''C:\Users'''The path to save the downloaded file locally
bSyncTruebooleanTrueThe command is run synchronously, and then returns to TRUE and wait for the file download to return to continue, transfer to false, then return to return immediately after downloading
iTimeOutTruenumber300000The timeout for the file to be downloaded. If it expires, it is determined that the download fails. The default time is 300000 milliseconds (5 minutes)
bContinueOnErrorNonebooleanNoneSpecify whether the automation should continue to support this field even if the activity is incorrect, it is only supported by the Boolean value (true, false) default value
iDelayAfterNonenumber300Delay time (in milliseconds) after executing the activity is 300 milliseconds
iDelayBeforeNonenumber200The delay time (in milliseconds) before any operations are executed is by default 200 milliseconds


/*********************************download file************** ************************ 
Command prototype:
Input parameters:
hWeb--Browser object
sURL--the link address (URL) of the file to be downloaded
sFile--path where the downloaded file is saved on this computer
bSync--Whether the command is executed synchronously
iTimeOut--timeout time for waiting for file download
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Dim hWeb,bRet
hWeb = WebBrowser.Create("ie","",30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sBrowserPath":"","sStartArgs":""})
hWeb = WebBrowser.BindBrowser("ie",10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
iRet = WebBrowser.GoURL(hWeb,"",false,{},30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})