Skip to main content


Command Description

Read the web page source code (HTML) of the current page. The read code is different from the web page source file. If the web page is built by JS, the read code will contain the rendered complete HTML structure tree

Command Prototype

sRet = WebBrowser.GetHTML(hWeb,optionArgs)

Parameter Description

hWebTrueexpressionhWebBrowser handle string using WebBrowser.create or WebBrowser.bind Command Returns
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


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


/************************************Read webpage source code************ **************************** 
Command prototype:
Input parameters:
hWeb--Browser object
bContinueOnError--whether to continue after error
iDelayAfter-- delay after execution
iDelayBefore--delay before execution
Outgoing reference:
sRet--the return value after the command is run
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})
sRet = WebBrowser.GetHTML (hWeb, {"bContinueOnError": false, "iDelayAfter": 300, "iDelayBefore": 200})
Log.Info (sRet)