title: Waiting for all the resources to load in Selenium with Python
body: <p>I am using <code>Selenium</code> with <code>Python</code> to obtain the <code>urls</code> (including <code>img</code> urls for ads which are typically located inside nested iframes) of all the resources requested by a webpage. This however, may not work for resources within <code>iframes</code> and for <code>ajax</code> requests. Reading the documentation on <a href="https://selenium-python.readthedocs.io/waits.html" rel="nofollow noreferrer">this</a> and looking at <a href="https://stackoverflow.com/questions/26566799/selenium-python-how-to-wait-until-the-page-is-loaded">other</a> <code>StackOverflow</code> answers, it seems like you can use <code>ExpectedCondition</code> to wait for an element to appear. But in my case, where I have to load several websites (several thousand <code>Top Alexa</code> sites), there may not be any common element on which I could wait for. I have been using <code>driver.set_page_load_timeout(60)</code> for that since <code>60</code> seconds seemed like a sufficiently long time for all the nested iframes to eventually turn up. I was wondering if anyone could confirm whether this is the correct way to go about it, and whether there is any other way which is better than this. Thanks.</p>
  
  <p>EDIT: I realize the question has been answered before, but for clarification of the specifics of my question, I believe all those answers offer a solution in terms of detecting an element which you know exists on the page, whereas in my case, I don't have any such knowledge pre-hand. </p>