IonicaBizau/scrape-it

Local file?

Closed this issue · 1 comments

I've done a wget -r on a site I want to scrape locally. Is there a way to do it on local files? Tried with file:// protocol and didn't work :(

Use the scrapeHTML method.

const fs = require("fs")
const scrapeIt = require("scrape-it")

const data = scrapeIt.scrapeHTML(fs.readFileSync("that-file.html", "utf-8"), {
  title: "h2#title" // your scrape it schema
})