1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-01-16 10:21:07 +01:00
Facebook-Events-iCal-Converter/lib/crawler.js
Ondrej Synacek 939980cae2 add logging
2019-10-16 08:59:47 +02:00

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