In my Selenium test I need simply save web page content after all Ajax objects has been loaded. I have found answers how to wait for Ajax loading, however there is no working solution for saving whole page with Ajax content. Here is source example:
with contextlib.closing(webdriver.Chrome()) as driver:
driver.get(url) # Load page
# Just as an example, wait manually until all Ajax objects are loaded.
raw_input("Done?")
# Save whole page
text = driver.page_source
# text contains original page data, no Ajax elements
I assume I need to tell web driver to check with the browser and update page_source property. Is there API for that? How do you save page containing Ajax objects?
Edit: Thanks for the reply! After re-testing with sample Ajax site I've figured that above code works. The problem was that the site uses frames, therefore I need to switch to a proper one. Here is another post answering that: What does #document mean?