Skip to content

memoize_articles not working? #659

Open
@Rapid1898-code

Description

@Rapid1898-code

Hello - i try to test the build function using this example -

import newspaper
cnn_paper = newspaper.build('http://cnn.com', memoize_articles=False)
for article in cnn_paper.articles:
    print(article.url)
print(cnn_paper.size())

When i run this the first time it works fine and all the article-links are outputted.
But when i run it the second time - using the memoize_articles parameter as you can see above - its only outputting 0 and with an error

(test) C:\DEVNEU\Python-Diverses\newspaper4k>python try2.py
C:\DEVNEU\.venv\test\Lib\site-packages\newspaper\source.py:260: FutureWarning: The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.
  if feed.doc:
0

Why is that? Shouldn´t the parameter be used to get nevertheless all articles?
Or how can i get to this article-links when i have allready fetched them before?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions