回复: Re: BeautifulSoup import error

Stefan Behnel stefan_ml at behnel.de
Fri May 6 01:57:51 EDT 2011


1011_wxy, 06.05.2011 04:29:
> 发件人: James Mills
>> On Fri, May 6, 2011 at 11:37 AM, 1011_wxy 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.
>
> BeautifulSoup does not work well with Python3.2 .

You can try to convert it using 2to3, though.


> I might suggest you take a look at using lxml instead

... which works with all Python versions from 2.3 through 3.2.


> which ships with the standard library.

No. While this has been suggested, it will not become part of the stdlib in 
the foreseeable future. It's readily available as a separate package on 
PyPI, though.

Stefan




More information about the Python-list mailing list