Is it possible to make selenium identify an html button attribute and click on it. So whenever it finds a button attribute it clicks on it automatically. Because I always have to predict around how long it takes for the next button to appear and set time.sleep()
but many times it results in errors.
Of coarse it is possible to identify an html button through an attribute and invoke click()
on it using Selenium.
But it won't be possible that, whenever a button is found through it's attribute, it can click on it automatically as:
time.sleep(n)
defeats the purpose of Automation and should be avoided at any cost.
You can find a relevant detailed discussion in How to sleep webdriver in python for milliseconds
time.sleep(n)
inducing WebDriverWait inconjunction with the expected_conditions.
You can find a relevant detailed discussion in How to get rid of the hardcoded sleep()?