回复: Re: BeautifulSoup import error

1011_wxy 1011_wxy at 163.com
Thu May 5 22:29:15 EDT 2011


Dear JM:

Thank you very much.
BeautifulSoup does not work well with Python3.2 .



2011-05-06



Kerry



发件人: James Mills <prologic at shortcircuit.net.au>
发送时间: 2011-05-06 09:47
主 题: Re: BeautifulSoup import error
收件人: python list <python-list at python.org>



On Fri, May 6, 2011 at 11:37 AM, 1011_wxy <1011_wxy at 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" 
--  
http://mail.python.org/mailman/listinfo/python-list 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110506/2641d38b/attachment.html>


More information about the Python-list mailing list