1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-01-29 08:29:25 +01:00

19 lines
403 B
JavaScript
Raw Normal View History

2019-10-15 09:22:08 +02:00
const puppeteer = require('puppeteer')
const crawl = async (url) => {
2019-10-16 08:59:47 +02:00
console.log(`crawl started for URL ${url}`)
2019-10-15 09:22:08 +02:00
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()
2019-10-16 08:59:47 +02:00
console.log(`crawl finished for URL ${url}`)
2019-10-15 09:22:08 +02:00
return html
}
module.exports = crawl