Skip to content

[Feature] Add page_load_state option to control page load wait behavior #218

@thalissonvs

Description

@thalissonvs

Currently, the page load is detected by repeatedly evaluating document.readyState and waiting until it equals 'complete'. The proposal is to introduce a new attribute in the Options object called page_load_state, which can have values like 'complete' or 'interactable'. The default would remain 'complete'.

This involves creating an Enum for these strategies to provide better typing and usability. Instead of checking document.readyState == 'complete', the code should compare it to self.options.page_load_state, making the wait behavior configurable.

This change will give users more control over how strictly the page load is waited on, enabling faster interactions when full page completeness isn't necessary.

The implementation touches the options class definition, typing, and the async wait loop for page load, so careful attention to tests and backwards compatibility is important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions