Async-await
IonicaBizau opened this issue · 3 comments
IonicaBizau commented
It doesn't seem to play well with async-await...
https://runkit.com/5af6881085a6d600128df514/5af68811cb36580012bde274?
aflansburg commented
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()
IonicaBizau commented
I am wondering if it comes from assured
: https://github.com/IonicaBizau/assured/blob/master/lib/index.js
Haven't debugged yet.
IonicaBizau commented
This should work now.