Reputation: 632
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.
Upvotes: 0
Views: 77
Reputation: 99011
To execute JavaScript on selenium python you can use:
driver.execute_script("toggleLogin('signInBlock','regBenefitsBlock');")
Upvotes: 1
Reputation: 474151
Locate the button by link text and use click()
method:
button = driver.find_element_by_link_text("Sign In")
button.click()
Upvotes: 3