Browse Source

feat: 重新获取 dom

zhangyuhan 1 year ago
parent
commit
3c85ea24bc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      bin/create-pdf/generateHTML.js

+ 1 - 1
bin/create-pdf/generateHTML.js

@@ -82,7 +82,7 @@ async function createHTMLOfURL (url, config = {}) {
     logger.log.debug('等待生成', new Date().toLocaleString())
 
     const html = await page.evaluate(() => {
-      const element = document.querySelector('.analysis-report');
+      const element = document.querySelector('.analysis-report') || document.querySelector('body');
       return element.outerHTML;
     });