Skip to content

Commit

Permalink
fix: error
Browse files Browse the repository at this point in the history
  • Loading branch information
14790897 committed Jan 14, 2025
1 parent a106c34 commit cff54ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bypasscf.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ async function login(page, username, password, retryCount = 3) {
page.click("#login-button", { force: true }), // 点击登录按钮触发跳转
]); //注意如果登录失败,这里会一直等待跳转,导致脚本执行失败 这点四个月之前你就发现了结果今天又遇到(有个用户遇到了https://linux.do/t/topic/169209/82),但是你没有在这个报错你提示我8.5
} catch (error) {
const alertError = await page.locator(".alert.alert-error");
const alertError = await page.$(".alert.alert-error");
if (alertError) {
const alertText = await alertError.innerText();
const alertText = await page.evaluate((el) => el.innerText, alertError); // 使用 evaluate 获取 innerText
if (alertText.includes("incorrect") || alertText.includes("不正确")) {
throw new Error(
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 密码 ${password}, 错误信息:${alertText}`
Expand Down
4 changes: 2 additions & 2 deletions bypasscf_likeUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,9 @@ async function login(page, username, password, retryCount = 3) {
page.click("#login-button", { force: true }), // 点击登录按钮触发跳转
]); //注意如果登录失败,这里会一直等待跳转,导致脚本执行失败 这点四个月之前你就发现了结果今天又遇到(有个用户遇到了https://linux.do/t/topic/169209/82),但是你没有在这个报错你提示我8.5
} catch (error) {
const alertError = await page.locator(".alert.alert-error");
const alertError = await page.$(".alert.alert-error");
if (alertError) {
const alertText = await alertError.innerText();
const alertText = await page.evaluate((el) => el.innerText, alertError); // 使用 evaluate 获取 innerText
if (alertText.includes("incorrect") || alertText.includes("不正确")) {
throw new Error(
`非超时错误,请检查用户名密码是否正确,失败用户 ${username}, 密码 ${password}, 错误信息:${alertText}`
Expand Down

0 comments on commit cff54ac

Please sign in to comment.