0

How do I wait for all the new elements that appear on the screen to load after clicking a specific button? I know that I can use the presence_of_elements_located function to wait for specific elements, but how do I wait until all the new elements have loaded on the page? Note that these elements might not necessarily have one attribute value like class name or id.

Ronith
  • 169
  • 2
  • 5
  • 12
  • (CORRECT ME SOMEONE, IF I AM WRONG) as far as I know thats kinda impossible to be done by python without using JavaScript ... problem with this, is that (Atleast I think its like that, cuz i tried to make i work many times) Selenium is using the html file that it optains on the openning of the website ... I might be wrong ... but If I am not, then u need to execute your command using somekina javascript (and if u want to scrape those data, that might be a problem) – StyleZ Jul 21 '20 at 19:50

1 Answers1

2

Well in reality you can't, but you can run a script to check for that.

However be wary that this will not work on javascript/AJAX elements.

self.driver.execute_script("return document.readyState").equals("complete"))

Crapy
  • 352
  • 1
  • 8