how can i call a javascript function in Selenium Python?
I'm trying to click on a button like this:
<a href="javascript:;" class="btndefault j-open-game j-gamingButton" data-gameid="1280" data-productid="2" ...>
But if i search it with:
btn = browser.find_element_by_class_name('btndefault j-open-game j-gamingButton')
I receive:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":".btndefault j-open-game j-gamingButton"}
if i search it with:
btn = browser.find_element_by_xpath("//button[@name='j-gamingButton']")
I receive:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[@name='j-gamingButton']"}
if i search it with:
btn = browser.find_element_by_xpath("//button[@name='j-btndefault j-open-game j-gamingButton']")
I receive:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[@name='j-btndefault j-open-game j-gamingButton']"}
if i search it with:
btn = browser.find_element_by_xpath("//button[@class='j-btndefault j-open-game j-gamingButton']")
I receive:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element:
Do you have any suggestions for me? Thanks in advance