Geeks, please accept the hero post of 2021 Microsoft x Intel hacking contest>>>
When learning web crawling, there is a problem in the first step
Executing sample code
from urllib.request import urlopen
from bs4 import BeautifulSoup
html = urlopen(” http://www.pythonscraping.com/exercises/exercise1.html “)
bsObj = BeautifulSoup(html, “html.parser”)
print(bsObj.h1)
Implementation results
Traceback (most recent call last):
File “D:/install/Python_ web Scraping/chapter1/BeautifulSoup.py”, line 2, in < module> from bs4 import BeautifulSoup ModuleNotFoundError: No module named ‘bs4’
Note: beautiful soup has been successfully installed in the terminal, but it still appears in idle
Solutions
1. In pychar Python file options, select the settings option and click in
2. Then select project interpreter
3. Double click pip
4. Search BS4, click Install, and the message of successful installation will be prompted
Similar Posts:
- Importerror: no module named BS4 error resolution
- Importerror: no module named BS4 error resolution
- [Solved] Python3 Error: ModuleNotFoundError: No module named ‘_bz2’
- ModuleNotFoundError No module named urllib2
- [Solved] Python Error: ModuleNotFoundError: No module named ‘tkinter’
- Python3 Use urlliburlopen error EOF occurred in violation of protocol (_ssl.c:841)
- How to Solve Beautifulsoup Error: “No module named ‘bs4’.” [from bs4 import BeautifulSoup]
- jupyter notebook error: No module named ‘tensorflow’
- Python for mac or windows: ModuleNotFoundError: No module named ‘lxml’ [How to Solve]
- from bs4 import BeautifulSoup Error [How to Solve]