is there a way that I can handle errors by how many times the error happens?
like I'm handling an error by exception like this
except NoSuchElementException:
driver.find_element_by_tag_name('body').send_keys(Keys.PAGE_DOWN)
sleep(randint(2,3))
continue
then I want if error except NoSuchElementException: happened like 5-6 times print something like job is done and break
how I am able to do that?
note: the above code is in a loop like for i in itertools.count(start=1):