Questions tagged [pageloadstrategy]

When a new document loads, the point at which the command returns the control is determined by the session’s page loading strategy.

When a new document loads, the point at which the command returns the control is determined by the session’s page loading strategy.

The normal state causes the control to return after the load event fires on the new page, eager causes the control to return after the DOMContentLoaded event fires, and none causes the control to return immediately.

The following is the table of page load strategies that links the pageLoadStrategy capability keyword to a page loading strategy state, and shows which document readiness state that corresponds to it:

page loading strategy

References

28 questions
27
votes
3 answers

Don't wait for a page to load using Selenium in Python

How do I make selenium click on elements and scrape data before the page has fully loaded? My internet connection is quite terrible so it sometimes takes forever to load the page entirely, is there anyway around this?
no nein
  • 631
  • 3
  • 10
  • 27
24
votes
2 answers

How to make Selenium not wait till full page load, which has a slow script?

Selenium driver.get (url) wait till full page load. But a scraping page try to load some dead JS script. So my Python script wait for it and doesn't works few minutes. This problem can be on every pages of a site. from selenium import…
bl79
  • 1,291
  • 1
  • 15
  • 23
21
votes
4 answers

Page load strategy for Chrome driver (Updated till Selenium v3.12.0)

I'm using Chrome browser for testing WebApp. Sometimes pages loaded after very long time. I needed to stop downloading or limit their download time. In FireFox I know about PAGE_LOAD_STRATEGY = "eager". Is there something similar for chrome? P.S.:…
6
votes
3 answers

React - correct way to wait for page load?

In React JS, what is the correct way to wait for a page to load before firing any code? Scenario: A login service authenticates a user then redirects them (with a cookie), to a React App. The React App then straight away searches for a cookie and…
js-learner
  • 457
  • 2
  • 9
  • 26
4
votes
2 answers

Selenium download entire html

I have been trying to use selenium to scrape and entire web page. I expect at least a handful of them are spa's such as Angular, React, Vue so that is why I am using Selenium. I need to download the entire page (if some content isn't loaded from…
Pink
  • 43
  • 1
  • 6
3
votes
2 answers

What is the correct syntax checking the .readyState of a website in Selenium Python?

I'm trying to check the .readyState of a website using .execute_script but I keep getting an error. I'm using a pageLoadStrategy of "none" in chromedriver so I'm trying to test that the websites readystate is no longer "loading". Note: this…
zao
  • 83
  • 1
  • 1
  • 6
2
votes
1 answer

Can Selenium detect when webpage finishes loading in Python3?

In python I wrote: driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options) driver.get(url) try: WebDriverWait(driver, 10).until( lambda driver: driver.execute_script('return…
2
votes
1 answer

Selenium automation Page Loading is very Slow

I am using chromedriver for selenium automation.But webpage loading is very slow compared to manual testing.Kindly help Getting error: [1596549682.992][SEVERE]: Timed out receiving message from renderer: 300.000 Code trials: ChromeOptions…
2
votes
1 answer

How to interact with an element before it is rendered within the HTML DOM through Selenium and Python

Is it possible request an URL and check for the elements before the page renders? I'm using Python + Selenium.
2
votes
2 answers

"Eager" Page Load Strategy workaround for Chromedriver Selenium in Python

I want to speed up the loading time for pages on selenium because I don't need anything more than the HTML (I am trying to scrape all the links using BeautifulSoup). Using PageLoadStrategy.NONE doesn't work to scrape all the links, and Chrome no…
1
vote
3 answers

Selenium unable to stop page loading

I do not face this problem with other websites but on this specific website: 1- I want to get my internet speed while using speedtest website by Selenium but the page cant stop loading. Because of that, I think that reason that I can't get the…
1
vote
1 answer

Improving loading time of webpage in python via selenium

How to reduce time of explicit wait of a page with full of AJAX statements? wait=WebDriverWait(driver,timeout=77) gives an exact results of located elements that I need, but consumed time is huge. When I set timeout time to lower than 70 the…
1
vote
1 answer

Selenium WebDriver Java: Change DOM before DOMContentLoaded

My aim is to change the DOM of a page before the DOMContentLoaded event. Let's say my JS would look like the code below and I want to change a value of an element: document.addEventListener("DOMContentLoaded", function(event) { console.log("Value…
user871611
  • 3,307
  • 7
  • 51
  • 73
1
vote
1 answer

What is the most efficient way to check if element exists in Selenium

Context: I mean to multi-thread several browsers instances and execute processes in them. Reason for question: I would like to know what is the most efficient/less consuming way to check for element in python selenium. I have tried two methods which…
1
vote
1 answer

Apps script: Show loader on button click

I am trying to show a loader in the google sheets sidebar on the button click either on the complete page or at least on the button so that users submitting the form should not press again until the earlier form is submitted. I have added loader…
1
2