vikarshana commited on
Commit
3890a46
·
verified ·
1 Parent(s): cb81bde

Update kontol.js

Browse files
Files changed (1) hide show
  1. kontol.js +2 -2
kontol.js CHANGED
@@ -21,10 +21,10 @@ app.get('/scrape', async (req, res) => {
21
  await page.goto(url, { waitUntil: 'load', timeout: 60000 });
22
  await page.waitForSelector('body');
23
 
24
- const content = await page.content();
25
  await browser.close();
26
 
27
- res.json({ html: content });
28
  } catch (error) {
29
  res.status(500).json({ error: 'Failed to scrape the website', details: error.message });
30
  }
 
21
  await page.goto(url, { waitUntil: 'load', timeout: 60000 });
22
  await page.waitForSelector('body');
23
 
24
+ const html = await page.content();
25
  await browser.close();
26
 
27
+ res.status(200).send(html);
28
  } catch (error) {
29
  res.status(500).json({ error: 'Failed to scrape the website', details: error.message });
30
  }