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

can't get the url's within the texts

mehrancodes opened this issue · comments

Hello there,
I tried this code with your website but seems that it doesn't pass the urls within the text.
How we could target them as well?

  scrapeIt("https://ionicabizau.net", {
    url: {
        selector: ".article-title"
      , attr: "href"
    }
  }).then(({ data, response }) => {
    scrapeIt(`https://ionicabizau.net${data.url}`, {
        title: '.content .article-title',
        desc: '.content .markdown'
    }).then(({ data, response }) => {
        console.log(data)
    })
  })

Yes I can get it now using the how option

description: {
  selector: 'article .entry-content',
  how: 'html'
}