I am using selenium to find a page and perform some action.
I have coded it in a way that if chrome is not able to find the page, go to the next one.
I have used try-catch for it but it is failing sometimes.
driver.get(url.text())
try:
element_present = EC.presence_of_element_located((By.TAG_NAME,'nav'))
WebDriverWait(driver, 50).until(element_present)
except:
driver.close()
continue
Sometimes it runs perfectly but sometimes it throws timeout exception... IDK why? It should go to exception...
File "index.py", line 124, in requests
driver.get(url.text())
selenium.common.exceptions.TimeoutException: Message: timeout
Any insights?