Upload index.js
Browse files
index.js
CHANGED
@@ -23,7 +23,9 @@ async function extractContentFromUrl(url, browser) {
|
|
23 |
waitUntil: 'domcontentloaded',
|
24 |
timeout: 60000
|
25 |
});
|
26 |
-
|
|
|
|
|
27 |
const content = await page.evaluate(() => {
|
28 |
const cleanText = (text) => {
|
29 |
return text ? text.replace(/\s+/g, ' ').trim() : '';
|
@@ -134,8 +136,6 @@ app.post('/extract-content', async (req, res) => {
|
|
134 |
headless: true,
|
135 |
});
|
136 |
|
137 |
-
console.log(`Memproses ${validUrls.length} URLs...`);
|
138 |
-
|
139 |
const concurrencyLimit = 3;
|
140 |
const results = [];
|
141 |
|
|
|
23 |
waitUntil: 'domcontentloaded',
|
24 |
timeout: 60000
|
25 |
});
|
26 |
+
|
27 |
+
await page.waitForTimeout(15000);
|
28 |
+
|
29 |
const content = await page.evaluate(() => {
|
30 |
const cleanText = (text) => {
|
31 |
return text ? text.replace(/\s+/g, ' ').trim() : '';
|
|
|
136 |
headless: true,
|
137 |
});
|
138 |
|
|
|
|
|
139 |
const concurrencyLimit = 3;
|
140 |
const results = [];
|
141 |
|