Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I cannot import beautiful soup on python

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?

like image 365
Kyungho Park Avatar asked Aug 08 '13 08:08

Kyungho Park


People also ask

How do you get BeautifulSoup in Python?

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 .

Do I need to install BeautifulSoup?

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).


2 Answers

The module names are case sensitive.

Try

from bs4 import BeautifulSoup
like image 121
shshank Avatar answered Oct 08 '22 07:10

shshank


Make sure you give 'B' and 'S' as capital while typing 'BeautifulSoup'

like image 26
Waajid Aslam Avatar answered Oct 08 '22 07:10

Waajid Aslam