Auto click a button in a web page
问题 I need to auto click on any of the "Add" buttons in a web page like as the following address: "https://groceries.asda.com/search/yoghurt" But, none of the "Add" buttons in the page has name or id. So I can not use driver.find_element_by_id() command from Selenium package. Can any one help me? 回答1: To click on any particular Add button for a particular product you can write a method as follows: def click_me(string): driver.find_element_by_xpath("//h3/a[@class='co-product__anchor' and contains(