Abhishek Mitra
Abhishek Mitra

Reputation: 51

Beautifulsoup is not a module

I tried to run the following code but i get the error Beautifulsoup is not a module:

import urllib
from Beautifulsoup import BeautifulSoup
webpage = urlopen('http://en.wikipedia.org/wiki/Mathematics').read

patfinderTitle = re.compile('<title>(.#)</title>')

if __name__=='__main__': main()

I've tried 'from bs4', used Easy_install, Python 2.7, BeautifulSoup 3.2.1, What do i do?

Upvotes: 0

Views: 185

Answers (1)

SheetJS
SheetJS

Reputation: 22925

The actual module name is BeautifulSoup (note case):

$ sudo easy_install beautifulsoup
$ python
>>> from BeautifulSoup import BeautifulSoup

For bs4:

$ sudo easy_install beautifulsoup4
$ python
>>> from bs4 import BeautifulSoup

Upvotes: 2

Related Questions