OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Cannot download article using newspaper3k

  • Thread starter Thread starter Udhai kumar
  • Start date Start date
U

Udhai kumar

Guest
I have even tried the commands in pypi.org but no article is getting downloaded.

Code:
from newspaper import Article

url = 'http://fox13now.com/2013/12/30/new-year-new-laws-obamacare-pot-guns-and-drones/'
article = Article(url)
article.download()
article.html

article.html only gives empty sting ' '. when i try article.parse() it gives error *

You must download() an article first!

I have tried workaround

Code:
while article.download_state == ArticleDownloadState.NOT_STARTED:
    # Raise exception if article download state does not change after 10 seconds
    if slept > 9:
        raise ArticleException('Download never started')
    sleep(1)
    slept += 1

still unable to solve the issue.
<p>I have even tried the commands in <a href="https://pypi.org/project/newspaper3k/" rel="nofollow noreferrer">pypi.org</a> but no article is getting downloaded. </p>

<pre><code>from newspaper import Article

url = 'http://fox13now.com/2013/12/30/new-year-new-laws-obamacare-pot-guns-and-drones/'
article = Article(url)
article.download()
article.html
</code></pre>

<p>article.html only gives empty sting ' '. when i try article.parse() it gives error *</p>

<blockquote>
<p>You must <code>download()</code> an article first!</p>
</blockquote>

<p>I have tried workaround </p>

<pre><code>while article.download_state == ArticleDownloadState.NOT_STARTED:
# Raise exception if article download state does not change after 10 seconds
if slept > 9:
raise ArticleException('Download never started')
sleep(1)
slept += 1
</code></pre>

<p>still unable to solve the issue.</p>
 

Latest posts

Top