Reputation: 23
I'm using a Jupyter notebook for this on the Google Cloud Platform.
This code previously worked fine so I'm not sure what to do.
I've tried uninstalling and reinstalling, restarting the kernals, doing a pip3 install.
Any ideas would be much appreciated. I've attached an image here.
Upvotes: 0
Views: 236
Reputation: 7685
Try this:
import bs4
req= requests.get("https://url")
page = req.content
soup = bs4.BeautifulSoup(page)
h1 = ...
And not
from bs4 import BeautifulSoup
Upvotes: 1
Reputation: 533
use this:
!pip install beautifulsoup4
from bs4 import BeautifulSoup as bs
Before doing it do Runtime->Reset all runtimes
Upvotes: 1