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

summary() throws away lots of text at some websites #151

Open
yevgenpapernyk opened this issue Jul 24, 2020 · 2 comments
Open

summary() throws away lots of text at some websites #151

yevgenpapernyk opened this issue Jul 24, 2020 · 2 comments

Comments

@yevgenpapernyk
Copy link

e.g. at https://edition.cnn.com/2020/07/24/politics/donald-trump-coronavirus-briefing-jacksonville/index.html

A lot of the text content is unfortunately not present in the .summary() result.

@buriy
Copy link
Owner

buriy commented Jul 24, 2020

This happens sometimes, the algorithm has very limited knowledge about blocks of text, image captions, comments and ads, and might confuse them, especially if the text in the HTML is interleaved with other blocks. Unless you can point on a specific bug or suggest adding a special rule for this website (that wouldn't reduce quality on other websites), I can do nothing about it.

@adbar
Copy link

adbar commented Aug 5, 2020

Same thing as in #150, you could try trafilatura which builds upon readability-lxml. I just tried and was able to extract the text you mentioned:

  • pip/pip3 install trafilatura
  • trafilatura -u "https://edition.cnn.com/2020/07/24/politics/donald-trump-coronavirus-briefing-jacksonville/index.html"

If it doesn't work, please provide us with precise examples of text portions which don't get extracted as you expect, this really helps!

@buriy buriy reopened this Aug 24, 2020
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

3 participants