Skip to content

Feature: Please add plain text output functionality #150

Description

@yevgenpapernyk

Like .summary() but plain text instead of the .summary() html version.

E.g. as a new method or as an argument for the .summary() method.

That would be very useful for Natural Language Processing.

Activity

  1. changed the title [-]Feature: Add plain text output functionality[/-] [+]Feature: Please add plain text output functionality[/+] on Jul 24, 2020
  2. buriy commented on Jul 24, 2020

    @buriy
    Owner

    I highly recommend using html2text library on the .summary() output for that.

        converter = HTML2Text()
        converter.ignore_links = True
        converter.ignore_emphasis = True
        converter.body_width = 0
        text = converter.handle(html)
        return text
    

    given that it's that easy and that different people need different rendering options, and the options might change over time and I would need to reflect them in the library interface, I'd like to leave it as is.
    However, I might consider adding a simple version, for that you need just .text_content() in lxml.

  3. adbar commented on Jul 29, 2020

    @adbar

    Shameless plug: trafilatura builds upon readability-lxml and can convert the output to TXT, XML, CSV and JSON.

  4. yevgenpapernyk commented on Aug 24, 2020

    @yevgenpapernyk
    Author

    However, I might consider adding a simple version, for that you need just .text_content() in lxml.

    So I'll leave the issue opened until you decide whether you want to add it, right?

  5. IdavalapatiRamanjaneyulu commented on Aug 17, 2021

    @IdavalapatiRamanjaneyulu

    Is there a plan to support textContent like we have in JS module https://github.com/mozilla/readability#parse?

  6. buriy commented on Aug 17, 2021

    @buriy
    Owner

    Yes if many people want an easy way to have text output, I'll add it.

  7. Seshu77 commented on Aug 20, 2021

    @Seshu77

    Could you please support to get clear text content?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions