mirror of
https://github.com/comatory/fb2iCal
synced 2025-01-16 10:21:07 +01:00
19 lines
403 B
JavaScript
19 lines
403 B
JavaScript
const puppeteer = require('puppeteer')
|
|
|
|
const crawl = async (url) => {
|
|
console.log(`crawl started for URL ${url}`)
|
|
const browser = await puppeteer.launch()
|
|
const page = await browser.newPage()
|
|
await page.goto(url)
|
|
|
|
const html = await page.evaluate(() => document.body.innerHTML)
|
|
|
|
await browser.close()
|
|
|
|
console.log(`crawl finished for URL ${url}`)
|
|
|
|
return html
|
|
}
|
|
|
|
module.exports = crawl
|