Home>

I'm learning basic scraping in python.
I have a question because the program cannot be executed due to the error of the following module.
Since I have just learned programming, there is a possibility that the terms etc. are wrong, but please forgive me.

File "chap2.py", line 2, in<module>
    from bs4 import Beautifulsoup
ImportError: cannot import name'Beautifulsoup' from'bs4'
Corresponding source code
import requests
from bs4 import Beautifulsoup
#Get and analyze web pages
load_url = "https://www.ymori.com/books/python2nen/test1.html"
html = requests.get (load_url)
super = Beautifulsoup (html.content, "html.parser")
#Display the entire HTML
print (super)
What I tried

I searched the net for the error code and ran pip3 install bs4, but it seems that bs4 is already installed and the error did not go away.

Supplementary information (FW/tool version, etc.)

Development environment is atom
os is Mac OS.

  • Answer # 1

    Capitalize S in the middle.

    -from bs4 import Beautifulsoup
    + from bs4 import BeautifulSoup
    -super = Beautifulsoup (html.content, "html.parser")
    + super = BeautifulSoup (html.content, "html.parser")