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


Groups > comp.lang.python > #4789

Re: BeautifulSoup import error

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-1.proxad.net!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <prologic@shortcircuit.net.au>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; '2.x': 0.05; '3.2': 0.07; 'exception,': 0.07; 'version?': 0.07; 'python': 0.07; '3.x': 0.09; 'received:209.85.160.174': 0.09; 'received:mail- gy0-f174.google.com': 0.09; 'to:name:python list': 0.09; 'exception': 0.12; 'subject:error': 0.12; 'syntax': 0.12; 'am,': 0.14; 'wrote:': 0.14; 'ported': 0.16; 'subject:import': 0.16; 'suggest': 0.19; 'appear': 0.19; 'maybe': 0.21; 'header:In-Reply- To:1': 0.22; 'version': 0.25; 'library.': 0.25; 'instead': 0.26; 'later': 0.26; 'fixed': 0.27; 'message-id:@mail.gmail.com': 0.28; 'received:209.85.160': 0.28; 'error': 0.29; 'fri,': 0.29; 'yet': 0.30; 'differences': 0.31; 'solved': 0.31; 'does': 0.31; 'import': 0.32; 'to:addr:python-list': 0.32; '...': 0.32; 'several': 0.33; 'using': 0.34; 'got': 0.34; 'there': 0.35; 'received:209.85': 0.37; 'received:google.com': 0.38; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'except': 0.39; 'would': 0.40; 'header:Received:5': 0.40; 'might': 0.40; '2011': 0.62; 'below.': 0.64; '11:37': 0.84; 'ships': 0.91
MIME-Version 1.0
In-Reply-To <6584008a.222d5.12fc2f1358d.Coremail.1011_wxy@163.com>
References <6584008a.222d5.12fc2f1358d.Coremail.1011_wxy@163.com>
From James Mills <prologic@shortcircuit.net.au>
Date Fri, 6 May 2011 11:46:30 +1000
Subject Re: BeautifulSoup import error
To python list <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1214.1304646413.9059.python-list@python.org> (permalink)
Lines 32
NNTP-Posting-Host 82.94.164.166
X-Trace 1304646413 news.xs4all.nl 65870 [::ffff:82.94.164.166]:47359
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:4789

Show key headers only | 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