({{, (RefLink[WebWindowObject, paclet:ref/WebWindowObject])[…] 
represents an open window or tab in a web browser.}})

OpenersNotesSection(Spacer1)Details

(RefLink[WebExecute, paclet:ref/WebExecute])[session,"BrowserWindows"] gives the current list of web window objects for a web session.

The following (RefLink[WebExecute, paclet:ref/WebExecute]) commands operate on windows specified by (RefLink[WebWindowObject, paclet:ref/WebWindowObject])[…]:

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Start a web session:

session = StartWebSession[]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to get the open window as a (RefLink[WebWindowObject, paclet:ref/WebWindowObject]):

WebExecute["BrowserWindows"]

Delete the session with (RefLink[DeleteObject, paclet:ref/DeleteObject]):

DeleteObject[session]

Start a web session:

session = StartWebSession[]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to open a new page:

WebExecute["OpenWebPage"->"https://www.wolfram.com"]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to open a new browser tab:

WebExecute["JavascriptExecute"->"window.open('https://www.wolframalpha.com', '_blank')"]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to get the open windows:

windows = WebExecute["BrowserWindows"]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to get the title of the first page:

WebExecute["PageTitle"]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to switch to the second window:

WebExecute["SetBrowserWindow"-> windows[[2]]]

Use (RefLink[WebExecute, paclet:ref/WebExecute]) to get the title of the second page:

WebExecute["PageTitle"]

Delete the session with (RefLink[DeleteObject, paclet:ref/DeleteObject]):

DeleteObject[session]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[WebExecute, paclet:ref/WebExecute])  ▪  (RefLink[WebSessionObject, paclet:ref/WebSessionObject])  ▪  (RefLink[StartWebSession, paclet:ref/StartWebSession])  ▪  (RefLink[WebElementObject, paclet:ref/WebElementObject])  ▪  (RefLink[$CurrentWebSession, paclet:ref/$CurrentWebSession])  ▪  (RefLink[NotebookObject, paclet:ref/NotebookObject])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Web Browser Automation, paclet:guide/WebBrowserAutomation])}, {▪(RefLinkPlain[Web Operations, paclet:guide/WebOperations])}})}})