0

I can access the tag below via css_selector but how do I do a button click?

<a title="Sign In" onclick="toggleLogin('signInBlock','regBenefitsBlock');" href="javascript:void(0);">Sign In</a>

Any idea would be appreciated.

2 Answers 2

3

Locate the button by link text and use click() method:

button = driver.find_element_by_link_text("Sign In")
button.click()
Sign up to request clarification or add additional context in comments.

Comments

1

To execute JavaScript on selenium python you can use:

driver.execute_script("toggleLogin('signInBlock','regBenefitsBlock');")

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.