Search code examples
pythonseleniumselenium-webdriversleepwebdriverwait

How to make selenium identify a button through an attribute within the HTML and click on it automatically whenever it is possible in python


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.


Solution

  • 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: