I am using Selenium
with Python
to obtain the urls
(including img
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 iframes
and for ajax
requests. Reading the documentation on this and looking at other StackOverflow
answers, it seems like you can use ExpectedCondition
to wait for an element to appear. But in my case, where I have to load several websites (several thousand Top Alexa
sites), there may not be any common element on which I could wait for. I have been using driver.set_page_load_timeout(60)
for that since 60
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.
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.