WebWindowObject

WebWindowObject[]

represents an open window or tab in a web browser.

Details

  • WebExecute[session,"BrowserWindows"] gives the current list of web window objects for a web session.
  • The following WebExecute commands operate on windows specified by WebWindowObject[]:
  • "SetBrowserWindow"windowmake a window active
    "SetWindowPosition"{window,{x, y}}set the screen position of a window
    "WindowMaximize"windowmaximize a window
    "WindowMinimize"windowminimize a window

Examples

Basic Examples  (2)

Start a web session:

In[1]:=
Click for copyable input
Out[1]=

Use WebExecute to get the open window as a WebWindowObject:

In[2]:=
Click for copyable input
Out[2]=

Delete the session with DeleteObject:

In[3]:=
Click for copyable input

Start a web session:

In[1]:=
Click for copyable input
Out[1]=

Use WebExecute to open a new page:

In[2]:=
Click for copyable input
Out[2]=

Use WebExecute to open a new browser tab:

In[3]:=
Click for copyable input

Use WebExecute to get the open windows:

In[4]:=
Click for copyable input
Out[4]=

Use WebExecute to get the title of the first page:

In[5]:=
Click for copyable input
Out[5]=

Use WebExecute to switch to the second window:

In[6]:=
Click for copyable input

Use WebExecute to get the title of the second page:

In[7]:=
Click for copyable input
Out[7]=

Delete the session with DeleteObject:

In[8]:=
Click for copyable input
Introduced in 2019
(12.0)