summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/index.js b/index.js
index a266cd6..98dd889 100644
--- a/index.js
+++ b/index.js
@@ -81,12 +81,13 @@ const responseHeadersToRemove = ["Accept-Ranges", "Content-Length", "Keep-Alive"
responseBody = await response.text();
responseData = await response.buffer();
while (responseBody.includes("cf-browser-verification") && tryCount <= 10) {
- response = await page.waitForNavigation({ timeout: 30000, waitUntil: 'domcontentloaded' });
+ newResponse = await page.waitForNavigation({ timeout: 30000, waitUntil: 'domcontentloaded' });
+ if (newResponse) response = newResponse;
responseBody = await response.text();
responseData = await response.buffer();
tryCount++;
}
- responseHeaders = response.headers();
+ responseHeaders = await response.headers();
const cookies = await page.cookies();
if (cookies)
cookies.forEach(cookie => {