Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97773

Unable to locate an element because of timeout in selenium python

$
0
0

I'm trying to finding a way to check if a new page/window is opened successfully and has content or not. I know that selenium is not able to check code 200 to see if the page is successfully loaded or not. So what should I do in order to find out if the page is loaded successfully?

while True:
        try:
            driver.find_element_by_css_selector("#showbtn").click()
            print ("Page Loaded Successfully")
            break
        except:
            print ("Page loading failed")
            time.sleep(5)

Viewing all articles
Browse latest Browse all 97773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>