Python Forum

Full Version: newspaper3k
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to web scrape news articles:

After installing newspaper3k, my code got stuck on the next line trying to import the required module.

pip install newspaper3k # ran ok

import newspaper # to import required module but this failed.

Can anyone assist me, please?
Not sure what you mean by my code got stuck on the next line, i.e. pip install newspaper3k should be executed in the terminal, not as part of the module/script
(Nov-30-2024, 10:01 PM)adeyeyej Wrote: [ -> ]I am trying to web scrape news articles:

After installing newspaper3k, my code got stuck on the next line trying to import the required module.

pip install newspaper3k # ran ok

import newspaper # to import required module but this failed.

Can anyone assist me, please?


Yes. It was executed in a separate cell in my Jupyter notebook.

Then in the next cell, I invoked:
import newspaper # this failed to execute.
(Nov-30-2024, 10:01 PM)adeyeyej Wrote: [ -> ]I am trying to web scrape news articles:

After installing newspaper3k, my code got stuck on the next line trying to import the required module.

pip install newspaper3k # ran ok

import newspaper # to import required module but this failed.

Can anyone assist me, please?


Yes. It was executed in a separate cell in my Jupyter notebook.

Then in the next cell, I invoked:
import newspaper # this failed to execute.
(Dec-01-2024, 08:23 AM)adeyeyej Wrote: [ -> ]Yes. It was executed in a separate cell in my Jupyter notebook.
Working example in Colab