FAQ
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 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>

Search Discussions

  • Stefan Behnel at May 6, 2011 at 5:57 am

    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
  • James Mills at May 6, 2011 at 6:11 am

    On Fri, May 6, 2011 at 3:57 PM, Stefan Behnel wrote:
    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.
    Opps I meant xml.etree :/
    My bad!

    cheers
    James

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedMay 6, '11 at 2:29a
activeMay 6, '11 at 6:11a
posts3
users3
websitepython.org

People

Translate

site design / logo © 2022 Grokbase