Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4789

Re: BeautifulSoup import error

References <6584008a.222d5.12fc2f1358d.Coremail.1011_wxy@163.com>
From James Mills <prologic@shortcircuit.net.au>
Date 2011-05-06 11:46 +1000
Subject Re: BeautifulSoup import error
Newsgroups comp.lang.python
Message-ID <mailman.1214.1304646413.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, May 6, 2011 at 11:37 AM, 1011_wxy <1011_wxy@163.com> wrote:
> I got a import error when I use Python 3.2 to import BeautifulSoup 3.2.0 .
> Is there any differences between Python 3.2 and other version? This is my
> first time to use Python3.2 .
> And the error message will be as below.

Judging from your tracebacks, it would appear
that BeuituflSoup has not yet been ported to
and/or fixed for Python 3 compatibility.

Maybe there's a later version of BeauitifulSOup
or a development version that does support Python 3?

There are several Syntax differences between
Python 2.x and Python 3.x - notably:

except Exception, e: # Python 2.x

except Exception as e: # Python 3.x

I might suggest you take a look at using lxml instead
which ships with the standard library.

[ ... ]

cheers
James

-- 
-- James Mills
--
-- "Problems are solved by method"

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: BeautifulSoup import error James Mills <prologic@shortcircuit.net.au> - 2011-05-06 11:46 +1000

csiph-web