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

memoize_articles not working? #659

Open
Rapid1898-code opened this issue Feb 7, 2025 · 0 comments
Open

memoize_articles not working? #659

Rapid1898-code opened this issue Feb 7, 2025 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@Rapid1898-code
Copy link

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?

@Rapid1898-code Rapid1898-code added the help wanted Extra attention is needed label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant