Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
newspaper3k
#1
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?
Reply
#2
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
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
(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.
Reply
#4
(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.
Reply
#5
(Dec-01-2024, 08:23 AM)adeyeyej Wrote: Yes. It was executed in a separate cell in my Jupyter notebook.
Working example in Colab
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020