Getting data after page update using Selenium


I am wondering if anyone knows a way to get page data after it updates content from a post request via Selenium. I understand that the way Selenium works is by when you get() a website it parses the content at its current state and then that is what you have have to work with but I am wondering if anyone knows how to get this updated conent without "getting" the page again?

Asked By: Lucian Chauvin



You need to wait for the visibility of some static element after the page is completely updated, before you attempt to get the data inducing WebDriverWait for the visibility_of_element_located() as follows:

WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//xpath_of_static_element")))

Note : You have to add the following imports :

from import WebDriverWait
from import By
from import expected_conditions as EC
Answered By: undetected Selenium