擅长:python、mysql、java
<p>另一种方法</p>
<pre><code>#You will get all 4 buttons xpath in a list
elements=driver.find_elements_by_xpath("//button[text()[contains(.,'Attack')]]")
#Now Iterate this It will click each button
for element in elements:
print(element.text)
element.click()
</code></pre>