我的函数 click() 不能与该站点的 href 一起使用,我该如何修复并使其正常工作?

My function click() dont work with href of this site, how i can fix and make work?

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
#Service("local do diretorio do chromeDriver")

driver = webdriver.Firefox('/home/arch/Downloads/bot/')
driver.get("https://blaze.com/pt/?modal=auth&tab=login")

element=driver.find_element_by_name("username").send_keys("email")
driver.find_element_by_name("password").send_keys("pass")
#link da url desejada

driver.find_element_by_xpath('/html/body/div[1]/main/div[3]/div/div[2]/div[2]/form/div[4]/button').click()
driver.find_element_by_xpath('/html/body/div[1]/main/div[1]/div[4]/div[2]/div[1]/div/div/div[4]/div[1]/div/div[3]/div/a')

我在 python 中有此代码,它在 blazer.com 中打开并进行登录,但是当我尝试单击此 href 中的 o 游戏地雷时:

<a href="/pt/games/mines"/>

不工作只是停止,有人可以帮助解决这个错误

您可能忘记点击“地雷”按钮。不要忘记代码末尾的 .click() ,如下所示:

driver.find_element_by_xpath('/html/body/div[1]/main/div[1]/div[4]/div[2]/div[1]/div/div/div[4]/div[1]/div/div[3]/div/a').click()

而且您可能还想通过导入时间并使用 time.sleep(x) 使代码休眠 x 秒来给网站一些加载时间。

import time

time.sleep(2) # Use this between the .click() lines to give the site time to load after clicking a button