Reputation: 51
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
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