diff --git a/lib/index.js b/lib/index.js index 0c2573b..dc6fbea 100644 --- a/lib/index.js +++ b/lib/index.js @@ -57,7 +57,11 @@ class PuppeteerPlugin { await page.close(); // convert utf-8 -> binary string because website-scraper needs binary - return Buffer.from(content).toString('binary'); + // https://github.com/website-scraper/node-website-scraper?tab=readme-ov-file#afterresponse: (binary) This is advised against because of the binary assumption being made can foul up saving of utf8 responses to the filesystem. + return { + body: content, + encoding: 'utf8' + }; } else { return response.body; }