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)) {