Skip to content

Page Load Strategy Settings#

PageLoadStrategy#

Class to configure page load strategy for Selenium as used in BrowserSettings.

Attributes:

Name Type Description
PageLoadStrategy.NORMAL Enum

Used by default. Waits for all resources to download. Ready state: Complete.

PageLoadStrategy.EAGER Enum

DOM access is ready, but other resources like images may still be loading. Ready state: Interactive.

PageLoadStrategy.NONE Enum

Does not block web driver at all. Ready state: Any.

Example

How to change the default page load strategy to eager:

1
2
3
4
5
6
from browserist import Browser, BrowserSettings, PageLoadStrategy

settings = BrowserSettings(page_load_strategy=PageLoadStrategy.EAGER)

with Browser(settings) as browser:
    browser.open.url("https://example.com")