SingleFile [1] can do that, i.e. automatically save viewed pages and/or bookmarks, but it will save pages in HTML. Alternatively, SingleFileZ [2] can do the same but will produce zip files (disguised as HTML files). Disclosure: I'm the author.
The below code does the job of saving the page as a single file.
```
const page = await this.browser.newPage()
const response = await page.goto(url, { timeout: 50000 })
if (response.status() === 404) {
await page.close()
throw new Error('not found')
}
// credit: https://stackoverflow.com/questions/54814323/puppeteer-how-to-download-entire-web-page-for-offline-use
const cdp = await page.target().createCDPSession();
const { data } = await cdp.send('Page.captureSnapshot', { format: 'mhtml' });
const htmlFilename = "./data/" + slugify(url)+'.mhtml';
fs.writeFileSync(htmlFilename, data);
```So far, SingleFile looks like a perfect fit, thanks!