[Python] Why is the summary() method on the Python newspaper3k module returning blank?

Discussão em 'Python' iniciado por Stack, Agosto 31, 2025.

  1. Stack

    Stack Membro Participativo

    I'm presently coding a quick python script to summarize a given news article using the newspaper3k module

    The following code to retrieve and print the text in the terminal works fine.

    import newspaper

    # Assign url
    url = 'url'

    # Extract web data
    url_i = newspaper.Article(url="%s" % (url), language='en')
    url_i.download()
    url_i.parse()


    # Display scraped data
    print(url_i.text)


    However, when I replace the text() method in the last line with the summary(), Nothing pops up, though i still get a code zero indicating that the compiler found no errors

    It seems that it is working but is just not displaying for some reason.

    Thanks.

    Tried looking at the documentation and online but .summary seems to work just fine for everyone else.

    Continue reading...

Compartilhe esta Página