<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<STYLE type=text/css> <!--@import url(D:\Program Files\NeteaseMail\Netease\网易闪电邮\\data\scrollbar.css); --></STYLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<STYLE>BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}; </STYLE>
<META name=GENERATOR content="MSHTML 8.00.7600.16766"><BASE
target=_blank></HEAD>
<BODY
style="BORDER-RIGHT-WIDTH: 0px; MARGIN: 12px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px"
marginheight="0" marginwidth="0"><STATIONERY>
<DIV>
<DIV><FONT color=#000000 size=3 face=宋体>Dear JM:</FONT></DIV>
<DIV><FONT face=宋体></FONT> </DIV>
<DIV><FONT color=#000000 size=3 face=宋体>Thank you very much.</FONT></DIV>
<DIV><FONT face=宋体>BeautifulSoup does not work well with Python3.2
.</FONT></DIV>
<DIV><FONT face=宋体></FONT> </DIV>
<DIV><FONT face=宋体></FONT> </DIV>
<DIV><FONT color=#000000 size=3 face=宋体></FONT> </DIV>
<DIV align=left><FONT color=#c0c0c0 size=2
face=Verdana>2011-05-06</FONT></DIV><FONT size=2 face=Verdana>
<HR style="WIDTH: 122px; HEIGHT: 2px" align=left SIZE=2>
<DIV><FONT color=#c0c0c0 size=2 face=Verdana><SPAN
id=_FlashSignName>Kerry</SPAN></FONT></DIV></FONT>
<DIV>
<HR>
</DIV>
<DIV>发件人: James Mills <prologic@shortcircuit.net.au></DIV>
<DIV>发送时间: 2011-05-06 09:47</DIV>
<DIV>主 题: Re: BeautifulSoup import error</DIV>
<DIV>收件人: python list <python-list@python.org></DIV>
<DIV><BR><BR></DIV>
<DIV>On Fri, May 6, 2011 at 11:37 AM, 1011_wxy <1011_wxy@163.com> wrote: </DIV>
<DIV>> I got a import error when I use Python 3.2 to import BeautifulSoup 3.2.0 . </DIV>
<DIV>> Is there any differences between Python 3.2 and other version? This is my </DIV>
<DIV>> first time to use Python3.2 . </DIV>
<DIV>> And the error message will be as below. </DIV>
<DIV> </DIV>
<DIV>Judging from your tracebacks, it would appear </DIV>
<DIV>that BeuituflSoup has not yet been ported to </DIV>
<DIV>and/or fixed for Python 3 compatibility. </DIV>
<DIV> </DIV>
<DIV>Maybe there's a later version of BeauitifulSOup </DIV>
<DIV>or a development version that does support Python 3? </DIV>
<DIV> </DIV>
<DIV>There are several Syntax differences between </DIV>
<DIV>Python 2.x and Python 3.x - notably: </DIV>
<DIV> </DIV>
<DIV>except Exception, e: # Python 2.x </DIV>
<DIV> </DIV>
<DIV>except Exception as e: # Python 3.x </DIV>
<DIV> </DIV>
<DIV>I might suggest you take a look at using lxml instead </DIV>
<DIV>which ships with the standard library. </DIV>
<DIV> </DIV>
<DIV>[ ... ] </DIV>
<DIV> </DIV>
<DIV>cheers </DIV>
<DIV>James </DIV>
<DIV> </DIV>
<DIV>-- </DIV>
<DIV>-- James Mills </DIV>
<DIV>-- </DIV>
<DIV>-- "Problems are solved by method" </DIV>
<DIV>-- </DIV>
<DIV>http://mail.python.org/mailman/listinfo/python-list </DIV></DIV></STATIONERY></BODY></HTML>