I installed Beautiful Soup library, and it seems to be well set up as there is the bs4
folder in C:\Python33\Lib\site-packages
.
(I changed the name into bs4
before installation, and it went the same after install)
But when I type in from bs4 import beautifulsoup
in the code, it says there is no such library.
And I don't see any beautifulsoup.py
or something. Isn't there supposed to be one?
I'm really confused. Anyone help please?
To use beautiful soup, you need to install it: $ pip install beautifulsoup4 . Beautiful Soup also relies on a parser, the default is lxml . You may already have it, but you should check (open IDLE and attempt to import lxml). If not, do: $ pip install lxml or $ apt-get install python-lxml .
Installing BeautifulSoup As BeautifulSoup is not a standard library, we need to install it. We are going to use the BeautifulSoup 4 package (known as bs4).
The module names are case sensitive.
Try
from bs4 import BeautifulSoup
Make sure you give 'B' and 'S' as capital while typing 'BeautifulSoup'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With