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

Add a option imgFallback which use img element's data-src attribute when #13

Closed entertainyou closed 8 years ago

entertainyou commented 8 years ago

src attribute is missing.

Tjatse commented 8 years ago

Appreciates! It's a good solution to solve some initial problems. But in some situations like following:

<img data-src-origin="my-pic.jpg" data-src-thumbnail="my-pic-50x50.jpg" />

It can not work any more, so how about define the imgFallback to be one of following types:

What do yo say?

entertainyou commented 8 years ago

I'll update the PR. Just to make sure, what you suggested is only applicable when src attribute is missing, right?

entertainyou commented 8 years ago

Pushed the update, and cheerio does not support .prop function, so only data-xxx or actual attribute is supported.

Tjatse commented 8 years ago

Merged, thanks!