我正在尝试使用 Python 中的 Selenium 自动执行“https://mirentapp.app/”的登录过程,但我无法成功登录。我的目标是导航到该页面,输入凭据,然后检索存储在本地存储中的用户令牌。但是,该过程似乎在登录步骤停止,我不明白为什么登录不成功。
这是我的代码的简化版本:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
# Initialize the WebDriver (assuming Chrome in this example)
options = webdriver.ChromeOptions()
options.add_argument("--disable-web-security")
options.add_argument("--user-data-dir=/path/to/chrome/profile")
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()))
# Navigate to the page where you need to perform the login
driver.get("https://qa.mirentapp.net/")
# Wait for the username field to be present
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, "email")))
driver.find_element(By.ID, "email").send_keys("YOUR_EMAIL")
password_field = driver.find_element(By.ID, "password")
password_field.send_keys("YOUR_PASSWORD")
password_field.send_keys(Keys.RETURN)
我尝试过的:
问题