Neosteam
Neosteam

Reputation: 51

How can i click to "javascript:void(0)" by selenium

Hello i'm want to click to Login button under a href="javascript:void(0) as html code below Due to my knowledge about coding is not enough so some one could help me how to click to this link?

I'm using selenium with python 3.9 . Thank you guys so much

<div class="flex items-center space-x-4 transition duration-150 ease-in-out text-gray-700 hover:text-primary-500 dark:text-gray-300 dark:hover:text-blue-200" x-show="!user.loggedIn &amp;&amp; !user.loading"><a href="javascript:void(0)" x-on:click="authorizeUser()">Register or Login</a></div>
<a href="javascript:void(0)" x-on:click="authorizeUser()">Register or Login</a>

Upvotes: 2

Views: 970

Answers (1)

George Imerlishvili
George Imerlishvili

Reputation: 1957

you can get a tag with driver.find_element and then click It

driver.find_element_by_link_text("Register or Login").click()

Upvotes: 1

Related Questions