I am trying to get an element from a website and I would get this error:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[2]/div[3]/div[1]/div[1]/button"}
I got the element by copying the XPath in inspect element and made sure the element exists and is clickable. Here is my code:
driver.find_element_by_xpath("/html/body/div[2]/div[3]/div[1]/div[1]/button").click()
Here is the HTML code:
<button class="styled joinRound" data-text="joinGame">Join game</button>
How can I fix this?