Skip to content

browser.window.set#

Functions#

height(height) #

If possible, restore the window and set the window height.

Note

Window size is not the same as the viewport size. The viewport is often smaller than the browser window that needs space for menus and buttons.

Parameters:

Name Type Description Default
height int

Height of the window in pixels.

required
Example
browser.window.set.height(600)

position(x, y) #

If possible, move the window to the chosen coordinate of the screen.

Parameters:

Name Type Description Default
x int

In pixels. Absolute X coordinate of the screen on the horisontal axis.

required
y int

In pixels. Absolute Y coordinate of the screen on the vertical axis.

required
Example

How to set the absolute position of the window to 100 pixels from the left and 100 pixels from the top of the screen, if possible:

Python
1
2
3
4
5
from browserist import Browser

with Browser() as browser:
    browser.window.set.position(100, 100)
    browser.open.url("https://example.com")

size(width, height) #

If possible, restore the window and set the window size.

Note

Window size is not the same as the viewport size. The viewport is often smaller than the browser window that needs space for menus and buttons.

Parameters:

Name Type Description Default
width int

Width of the window in pixels.

required
height int

Height of the window in pixels.

required
Example
browser.window.set.size(800, 600)

width(width) #

If possible, restore the window and set the window width.

Note

Window size is not the same as the viewport size. The viewport is often smaller than the browser window that needs space for menus and buttons.

Parameters:

Name Type Description Default
width int

Width of the window in pixels.

required
Example
browser.window.set.width(800)