From 94e1b40d7ebb407bfff57b887e386cfa89d55114 Mon Sep 17 00:00:00 2001 From: Smilin Date: Mon, 29 Apr 2024 15:14:09 +0800 Subject: [PATCH] =?UTF-8?q?0.16=20=E9=81=A9=E9=85=8D=20pixai=20ui=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 14 ++++++++++++-- package.json | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/app.js b/app.js index 13b823f..aa244b6 100644 --- a/app.js +++ b/app.js @@ -106,11 +106,21 @@ async function selectProfileButton(page) { try { await page.click('button[type="submit"]'); } catch {} - const headerText = await page.$eval( + let headerText = await page.$eval( "header > div:nth-of-type(2)", (el) => el.innerText ); - if (headerText.includes("Sign Up") || headerText.includes("Log in")) { + // 適配 UI 版本 + if (headerText == null) + headerText = await page.$eval( + "header > div:nth-of-type(1)", + (el) => el.innerText + ); + if ( + !headerText || + headerText.includes("Sign Up") || + headerText.includes("Log in") + ) { console.log("未登入"); continue; } else { diff --git a/package.json b/package.json index 4809a17..d33affc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "auto-pixai", - "version": "0.15", + "version": "0.16", "description": "自動領取pixai.art獎勵", "main": "app.js", "scripts": {