2

So I want to click all the buttons with the button label "CLAIM", however it is not working. There are multiple buttons with this label so I tried making this:

like = driver.find_elements_by_class_name('CLAIM')
    for x in range(0,len(like)):
                if like[x].is_displayed():
                        like[x].click()

The button:

<div class="label">CLAIM</div>

I've tried using xpath but there are multiple buttons with this label. Can anyone help

1 Answer 1

2

Simply find the divs with class label and text CLAIM and loop through them.

likes = driver.find_elements_by_xpath("//div[@class='label' and .='CLAIM']")
for like in likes:
    like.click()
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.