Mohammad Mohammad -3 years ago 255
Python Question

How can I from bs4 import BeautifulSoup?

This code:

from bs4 import BeautifulSoup

Doesn't work, and gives this error :

raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__,attr)
SyntaxError: invalid syntax

What should i do ?

Answer Source

You should be using pip to install, so you can simply do

pip install beautifulsoup4

That will install the latest BS4, which is 4.3.1 as of 2013-08-15. It supports Python 3.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download