From 4c10fe4434ca758bd48c084dc1036942d1108ec6 Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 14 Dec 2023 19:45:14 +0800 Subject: [PATCH 1/2] fix: re-pull latest anchor element after refreshing related #5 --- src/index.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 44cedc6c..81ffdf41 100644 --- a/src/index.ts +++ b/src/index.ts @@ -57,11 +57,9 @@ export const fetchJsUrl = async ({ { waitUntil: 'networkidle0' }, ) - const anchor = await page.waitForSelector('a#J_cdn_type_svgsymbol') - - const copy = await page.$('.project-code-top .cover-btn:not(:last-child)') + await page.waitForSelector('a#J_cdn_type_svgsymbol') - if (copy) { + if (await page.$('.project-code-top .cover-btn:not(:last-child)')) { const refresh = await page.$('.project-code-top .cover-btn:last-child') await refresh!.click() const button = await page.waitForSelector( @@ -76,6 +74,9 @@ export const fetchJsUrl = async ({ ) } + // re-pull latest anchor element after refreshing + const anchor = await page.waitForSelector('a#J_cdn_type_svgsymbol') + const jsUrl = await anchor!.evaluate(el => el.href) await browser.close() From b6939336a17f5d7f9425992b176d2e11d0959791 Mon Sep 17 00:00:00 2001 From: JounQin Date: Thu, 14 Dec 2023 19:48:54 +0800 Subject: [PATCH 2/2] Create beige-points-decide.md --- .changeset/beige-points-decide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/beige-points-decide.md diff --git a/.changeset/beige-points-decide.md b/.changeset/beige-points-decide.md new file mode 100644 index 00000000..1335875f --- /dev/null +++ b/.changeset/beige-points-decide.md @@ -0,0 +1,5 @@ +--- +"dl-iconfont": patch +--- + +fix: re-pull latest anchor element after refreshing