I'm learning Python and have a huge interest in bots and scraping.
I made the code below to extract the h1 text from a web page, but an error comes up when running it in the shell saying "No module named urllib2" Most of this code is from the internet... what do I do to make urllib2 found?
Here is my python code:
bs4 cannot also be found... Any clue?
I made the code below to extract the h1 text from a web page, but an error comes up when running it in the shell saying "No module named urllib2" Most of this code is from the internet... what do I do to make urllib2 found?
Here is my python code:
import urllib2 from bs4 import BeautifulSoup quote_page = 'https://amazon.com' page = urllib2.urlopen(quote_page) soup = BeautifulSoup(page, 'html.parser') name_box = soup.find('h1', attrs{class': 'name'}) name = name_box.text.strip() print(name)Does anybody know the issue? (sorry if I'm being stupid here).
bs4 cannot also be found... Any clue?