In Python and Selenium, I want to click all the a
tag with the same XPath and same title. But I don't think so there is any way to click all the a
tag one by one.
If you have any suggestion please help me.
答案 0 :(得分:0)
尝试一下:
import time
# locate all elements
elements = driver.find_elements_by_xpath("xPath_to_elements")
for x in range(0, len(elements)):
elements[x].click() # click on every element
time.sleep(1) # small pause between clicks