{"id":507093,"date":"2026-07-03T07:46:00","date_gmt":"2026-07-03T07:46:00","guid":{"rendered":"https:\/\/livelycity.com\/switzerland\/wait-until-page-is-loaded-with-selenium-webdriver-for-python\/"},"modified":"2026-07-03T07:46:00","modified_gmt":"2026-07-03T07:46:00","slug":"wait-until-page-is-loaded-with-selenium-webdriver-for-python","status":"publish","type":"post","link":"https:\/\/livelycity.com\/switzerland\/wait-until-page-is-loaded-with-selenium-webdriver-for-python\/","title":{"rendered":"Wait until page is loaded with Selenium WebDriver for Python"},"content":{"rendered":"<p>The wait_for helper function is good, but unfortunately click_through_to_new_page is open to the race condition where we manage to execute the script in the old page, before the browser has started processing the click, and page_has_loaded just returns true straight away. id Comparing new page ids with the old one:<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/26566799\/wait-until-page-is-loaded-with-selenium-webdriver-for-python\" target=\"_blank\" class=\"\">https:\/\/stackoverflow.com\/questions\/26566799\/wait-until-page-is-loaded-with-selenium-webdriver-for-python<\/a>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The wait_for helper function is good, but unfortunately click_through_to_new_page is open to the race condition where we manage to execute the script in the old&#8230;<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-507093","post","type-post","status-publish","format-standard","hentry","category-kunsthaus-zurich-en","wpcat-13-id"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/posts\/507093","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/comments?post=507093"}],"version-history":[{"count":0,"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/posts\/507093\/revisions"}],"wp:attachment":[{"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/media?parent=507093"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/categories?post=507093"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/livelycity.com\/switzerland\/wp-json\/wp\/v2\/tags?post=507093"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}