Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isProbablyReaderable #174

Open
Uzay-G opened this issue May 25, 2022 · 3 comments
Open

isProbablyReaderable #174

Uzay-G opened this issue May 25, 2022 · 3 comments

Comments

@Uzay-G
Copy link

Uzay-G commented May 25, 2022

How difficult would it be to implement isProbablyReaderable(doc, options) (from https://github.com/mozilla/readability#isprobablyreaderabledocument-options).

This would allow to check when a webpage is actually interesting / relevant for scraping and save on speed.

Would this be hard to implement? I could also try working on it.

@buriy
Copy link
Owner

buriy commented May 27, 2022

It's not difficult to implement in that way, but I'm afraid you won't get any big improvement in parsing time (now typical article processing time is 0.1-0.4 s per page), nor it's reliable, or, to be more precise:

  • If you use minScore check, readability algorithm is completely the same but without cleaning phase, will take almost the same time.
  • If you could only check HTML, it's completely unreliable.

@Uzay-G
Copy link
Author

Uzay-G commented May 28, 2022

Oh I see. What could I do to use readability to check if a webpage actually has like interesting content?

Where an actual article passes this check and something like the google homepage doesn't.

@buriy
Copy link
Owner

buriy commented May 29, 2022

The main check should be whether there's something to read: text with length starting from 300 chars. Ideally, 500+ chars.
You can check this after processinging with readability: just convert to text and check the length.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants