1
0
mirror of https://github.com/comatory/fb2iCal synced 2024-12-29 09:50:55 +01:00
Facebook-Events-iCal-Converter/lib/crawler.js
2019-10-16 09:07:20 +02:00

22 lines
458 B
JavaScript

const puppeteer = require('puppeteer')
const crawl = async (url) => {
console.log(`crawl started for URL ${url}`)
const browser = await puppeteer.launch({
headless: true,
args: [ '--no-sandbox' ],
})
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