message: Get full page content.
diff: @@ -61,15 +61,15 @@ export class PuppetMaster {
  }
  private async cachePage() {
  - const bodyHTML = await this.page.evaluate(() => document.body.innerHTML);
  - const headHTML = await this.page.evaluate(() => document.head.innerHTML);
  - const cleanBodyHTML = bodyHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
  - const cleanHeadHTML = headHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
  - const pageHTML = this.craftPage(cleanHeadHTML, cleanBodyHTML);
  - // const pageContent = await this.page.content();
  - // const cleanContent = pageContent.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
  + // const bodyHTML = await this.page.evaluate(() => document.body.innerHTML);
  + // const headHTML = await this.page.evaluate(() => document.head.innerHTML);
  + // const cleanBodyHTML = bodyHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
  + // const cleanHeadHTML = headHTML.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
  + // const pageHTML = this.craftPage(cleanHeadHTML, cleanBodyHTML);
  + const pageContent = await this.page.content();
  + const cleanContent = pageContent.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "");
  if (this.cache) {
  - this.cache.set(`${this.tenantId}-${this.documentId}`, pageHTML).then(() => {
  + this.cache.set(`${this.tenantId}-${this.documentId}`, cleanContent).then(() => {
  console.log(`Updated cache`);
  }, (err) => {
  console.log(`Error: ${err}`);
  @@ -77,6 +77,7 @@ export class PuppetMaster {
  }
  }
  + /*
  private craftPage(headHTML: string, bodyHTML: string) {
  const html = `
  <!DOCTYPE html>
  @@ -91,5 +92,5 @@ export class PuppetMaster {
  </body>
  </html>`;
  return html;
  - }
  + }*/
  }
  