From 574b68f053e0e20cee547b0779bc92391ef8f5eb Mon Sep 17 00:00:00 2001 From: ghr <18435186204@163.com> Date: Mon, 13 Apr 2026 18:47:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=88=AA=E5=9B=BE=E5=89=8D=E6=89=A7?= =?UTF-8?q?=E8=A1=8CJS=E4=BF=AE=E5=A4=8Dtable=E6=A0=87=E7=AD=BEdisplay?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/daily.js | 8 ++++++++ scripts/screenshot.js | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/scripts/daily.js b/scripts/daily.js index df9ea58..8d863ae 100644 --- a/scripts/daily.js +++ b/scripts/daily.js @@ -76,6 +76,14 @@ async function main() { // 额外等待3秒确保动态内容加载 await page.waitForTimeout(3000); + // 执行JS:将所有 table 标签的 display 改为 table + await page.evaluate(() => { + const tables = document.querySelectorAll('table'); + tables.forEach(table => { + table.style.display = 'table'; + }); + }); + // 截图 await page.screenshot({ path: picPath, diff --git a/scripts/screenshot.js b/scripts/screenshot.js index cc7acf0..d72600e 100644 --- a/scripts/screenshot.js +++ b/scripts/screenshot.js @@ -57,6 +57,14 @@ async function screenshot(url, outputPath) { // 额外等待3秒确保动态内容加载 await page.waitForTimeout(3000); + // 执行JS:将所有 table 标签的 display 改为 table + await page.evaluate(() => { + const tables = document.querySelectorAll('table'); + tables.forEach(table => { + table.style.display = 'table'; + }); + }); + // 确保输出目录存在 const outputDir = path.dirname(outputPath); if (!fs.existsSync(outputDir)) {