May 28, 2023

Stop infinite page load in selenium webdriver python

“Eager” page loading strategy will make WebDriver wait until the initial HTML document has been completely loaded and parsed, and discards loading of stylesheets, images and subframes (DOMContentLoaded event fire is returned).

Example usage for Python:

from selenium import webdriver
from import Options
options = Options()
options.page_load_strategy = 'eager'
driver = webdriver.Chrome(options=options)
# Navigate to url

Leave a Reply