Spaces:
Sleeping
Sleeping
Update kontol.js
Browse files
kontol.js
CHANGED
|
@@ -13,11 +13,12 @@ app.get('/scrape', async (req, res) => {
|
|
| 13 |
const context = await browser.newContext({
|
| 14 |
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
| 15 |
viewport: { width: 1280, height: 720 },
|
|
|
|
| 16 |
bypassCSP: true
|
| 17 |
});
|
| 18 |
|
| 19 |
const page = await context.newPage();
|
| 20 |
-
await page.goto(url, { waitUntil: '
|
| 21 |
await page.waitForSelector('body');
|
| 22 |
|
| 23 |
const content = await page.content();
|
|
|
|
| 13 |
const context = await browser.newContext({
|
| 14 |
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
| 15 |
viewport: { width: 1280, height: 720 },
|
| 16 |
+
javaScriptEnabled: true,
|
| 17 |
bypassCSP: true
|
| 18 |
});
|
| 19 |
|
| 20 |
const page = await context.newPage();
|
| 21 |
+
await page.goto(url, { waitUntil: 'load', timeout: 60000 });
|
| 22 |
await page.waitForSelector('body');
|
| 23 |
|
| 24 |
const content = await page.content();
|