This should be better wrt stale elements as it only reads the html of the element once, then does the looping over the contents of all_pages.