codelucas / newspaper

newspaper3k is a news, full-text, and article metadata extraction in Python 3. Advanced docs:
https://goo.gl/VX41yK
MIT License
13.89k stars 2.1k forks source link

Article() not returning anything when fed article links #958

Closed SohailSayed closed 1 year ago

SohailSayed commented 1 year ago

For example, I'm following this tutorial (https://www.geeksforgeeks.org/scraping-websites-with-newspaper3k-in-python/)

This prints blank

import newspaper

url = 'https://www.geeksforgeeks.org/top-5-open-source-online-machine-learning-environments/'

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

print(url_i.text)

Tried Article() on a CBC and CNN article too, and both were completely blank (all attributes)

SohailSayed commented 1 year ago

Apologies, there was an error with my local environment, everything seems to be running fine