summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
authorEmilien Devos <contact@emiliendevos.be>2020-06-06 19:16:09 +0200
committerEmilien Devos <contact@emiliendevos.be>2020-06-06 19:16:09 +0200
commit1e6136e05ae923f25922f034a0c70074f45875c0 (patch)
tree810cd3de49c9d3c7ae9948c915cda4374b350880 /index.js
parent733ab1b3d2996eed30aa3f15ac115ad4a710d3fa (diff)
fix fetching response body
Diffstat (limited to 'index.js')
-rw-r--r--index.js4
1 files changed, 1 insertions, 3 deletions
diff --git a/index.js b/index.js
index a307db8..c8661cd 100644
--- a/index.js
+++ b/index.js
@@ -1,7 +1,5 @@
const puppeteer = require('puppeteer-extra');
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
-const AdblockerPlugin = require('puppeteer-extra-plugin-adblocker');
-puppeteer.use(AdblockerPlugin());
puppeteer.use(StealthPlugin());
const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
@@ -76,7 +74,7 @@ const responseHeadersToRemove = ["Accept-Ranges", "Content-Length", "Keep-Alive"
response = await page.goto(url, { timeout: 30000, waitUntil: 'domcontentloaded' });
if ((await page.content()).includes("cf-browser-verification"))
response = await page.waitForNavigation({ timeout: 30000, waitUntil: 'domcontentloaded' });
- responseBody = await page.content();
+ responseBody = await response.text();
responseHeaders = response.headers();
const cookies = await page.cookies();
if (cookies)