Tjatse / node-readability

Scrape/Crawl article from any site automatically. Make any web page readable, no matter Chinese or English.
341 stars 36 forks source link

[feature] customize title, content selectors #11

Closed Tjatse closed 8 years ago

Tjatse commented 8 years ago

e.g.:

read('htttp://example.com', {
  selectors: {
    title: '.article>.title',
    content: '.article>.body, .license',
    author: '.article .author+.subscribe'
  }
}, function(err, art){
  // $('.article>.title').text() will be the art.title 
  // $('.article>.body, .license').[text / html]() will be the art.content
  // and extra data: $('.article .author+.subscribe') will be art.author
});
Tjatse commented 8 years ago

v0.4.0