IonicaBizau / scrape-it

🔮 A Node.js scraper for humans.

Home Page:http://ionicabizau.net/blog/30-how-to-write-a-web-scraper-in-node-js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Async-await

IonicaBizau opened this issue · comments

Altering your code sample seems to work:

const scrapeIt = require("scrape-it")
 
const myFunction = async () =>  { return await scrapeIt("https://nmotw.in", {tagLine: ".tagline"}) }
myFunction().then(res=>console.log(res));

I'm not sure why your syntax caused the url parameter to not be passed to scrapeIt()

I am wondering if it comes from assured: https://github.com/IonicaBizau/assured/blob/master/lib/index.js

Haven't debugged yet.

This should work now.