Python auto click button on website
I need to auto click on any of the "Add" buttons in a web page like as the following address: Show "https://groceries.asda.com/search/yoghurt" But, none of the "Add" buttons in the page has name or id. So I can not
use Can any one help me?
Guy 42.6k10 gold badges36 silver badges78 bronze badges asked Dec 12, 2019 at 20:04
1
To click on any particular Add button for a particular product you can write a method as follows:
Now you can click on any of the Add button passing their title as follows:
answered Dec 12, 2019 at 21:15
6 Use a similar method
as the buttons have identifying classes. Afterwards, you can click each of these buttons:
answered Dec 12, 2019 at 20:10
ArnArn 1,81011 silver badges25 bronze badges 2 are you saying you want to click on an add with python? for do that, you can do this:
answered Dec 12, 2019 at 20:11 1 Not the answer you're looking for? Browse other questions tagged python selenium selenium-webdriver webdriver or ask your own question.How do you automate a button click in Python?Steps by step Approach:. Import required modules.. Create webdriver object.. Assign URL.. Use maximize_window() method to maximize the browser window. And then wait 10 seconds using sleep() method.. Use find_element_by_link_text() method to click button by text.. Can I use Python to click button on webpage?We can find the button on the web page by using methods like find_element_by_class_name(), find_element_by_name(), find_element_by_id() etc, then after finding the button/element we can click on it using click() method. This will click on the button and a popup will be shown.
How do I automatically click a button on a web page?How to Automate Clicks Using JavaScript. . document. getElementById("clickMe"). click();. for ( let i = 0; i < 1000; i++ ) { document.getElementById("clickMe").click(); }. |