Skip to main content

Open-Webpage

Command Description

Control the browser to load the specified link (URL)

Command Prototype

iRet = WebBrowser.GoURL(hWeb,sURL,bWait,arrElement,iTimeOut,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
hWebTrueexpressionhWebBrowser handle string using WebBrowser.create or WebBrowser.bind Command Returns
sURLTruestring""The webpage link address (URL) to be loaded
bWaitTruebooleanTrueWhether waiting for the page to load, the command returns, passes to true, etc., you must wait for page Load SuccessFully or Load Faile, will continue, and return to false and return to the page
arrElementTruedecorator{}Judge the existence of specified element after page loading. If left blank, no element will be evaluated
iTimeOutTruenumber30000Timeout of waiting for the page to finish loading. If this time is exceeded, it will be determined as loading failure. By default the timeout is 30000 milliseconds (30 seconds)
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

return

iRet,The variable used to save the output of the command.

Demo

/*********************************open the Web page************** ************************ 
Command prototype:
WebBrowser.GoURL(hWeb,sURL,bWait,arrElement,iTimeOut,optionArgs)
Input parameters:
hWeb--Browser object
sURL--the link address of the web page to be loaded
bWait--Whether to wait for the command to return after the page is loaded
arrElement--Determine whether the specified element exists
iTimeOut--timeout for waiting for page load
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Outgoing reference:
iRet--command return result
*********************************************************************************/
Dim hWeb,iRet
hWeb = WebBrowser.Create("ie","www.baidu.com",30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200,"sBrowserPath":"","sStartArgs":""})
TracePrint(hWeb)
hWeb = WebBrowser.BindBrowser("ie",10000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint(hWeb)
iRet = WebBrowser.GoURL(hWeb,"weibo.com",true,{},30000,{"bContinueOnError":false,"iDelayAfter":300,"iDelayBefore":200})
TracePrint(iRet)