Skip to content

Commit

Permalink
0.16 適配 pixai ui 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Smilin committed Apr 29, 2024
1 parent b960d8a commit 94e1b40
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-pixai",
"version": "0.15",
"version": "0.16",
"description": "自動領取pixai.art獎勵",
"main": "app.js",
"scripts": {
Expand Down

0 comments on commit 94e1b40

Please sign in to comment.