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


Groups > comp.lang.python > #97417

Re: Parsing HTML with xml.etree in Python 2.7?

Path csiph.com!goblin2!goblin.stu.neva.ru!feeder1.cambriumusenet.nl!feed.tweak.nl!194.109.133.81.MISMATCH!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail
Return-Path <skip.montanaro@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'modify': 0.04; 'subject:Python': 0.05; 'api': 0.09; 'subject:2.7': 0.09; ':-)': 0.12; 'wrote:': 0.16; "wouldn't": 0.16; 'skip': 0.18; 'changes': 0.20; '2015': 0.20; 'mind.': 0.22; 'parse': 0.22; 'am,': 0.23; 'code.': 0.23; 'xml': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message-id:@mail.gmail.com': 0.27; 'package.': 0.27; 'robust': 0.29; 'code': 0.30; 'writes': 0.30; 'surprised': 0.33; 'received:google.com': 0.35; 'there': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'turned': 0.38; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'some': 0.40; 'caused': 0.61; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=WeK8gOMVSWNPrVe1SbtH/CXGjZPRtLtrJLbdFuDqb2o=; b=DbdmT/kLfW7lJRwkPbMILEcIRX45G5fciqAxWMZPsoY3bh46NzRCTtmkjiqC/AIXXA RtCGBTCPmT/FRCBYjSZTsc2PneUnPgh9b2S78xSNk4LMQ3kpDlbwaPr2+o5HO+AUg23l 7Sgjd6EbJcgVK5iIXEI51tknKoxYEaC4I1RiXh7pWuppr126t0vrc5DSAjw7fv1KPvol FmeNN+ej8H8P5x6WW52pRmVfDmhy6guB3LI/NfW+fuUfeEOo9idsjxBW+dCuitkpDNVq to7UFsKRYhkXyzc5VdsWvpp7zuct8UpRq7oarIWUcMbUueZg78GdxJKtiebO1oopjy1i IklA==
MIME-Version 1.0
X-Received by 10.107.135.196 with SMTP id r65mr33625899ioi.131.1444058104604; Mon, 05 Oct 2015 08:15:04 -0700 (PDT)
In-Reply-To <CANc-5UwFL8aFQ5kkONMEFg=K1vm1cvwJrk1S0EBY+GYVC6V8-g@mail.gmail.com>
References <CANc-5UwFL8aFQ5kkONMEFg=K1vm1cvwJrk1S0EBY+GYVC6V8-g@mail.gmail.com>
Date Mon, 5 Oct 2015 10:15:04 -0500
Subject Re: Parsing HTML with xml.etree in Python 2.7?
From Skip Montanaro <skip.montanaro@gmail.com>
To Python <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.398.1444058107.28679.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1444058107 news.xs4all.nl 23795 [2001:888:2000:d::a6]:33453
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:97417

Show key headers only | View raw


On Mon, Oct 5, 2015 at 9:14 AM, Skip Montanaro <skip.montanaro@gmail.com> wrote:
> I wouldn't be surprised if there were some small API changes other than the
> name change caused by the move into the xml package. Before I dive into a
> rabbit hole and start to modify elementtidy, is there some other stdlib-only
> way to parse HTML code into an xml.etree.ElementTree?

Never mind. The only change necessary turned out to be the import. /F
writes robust code. :-)

Skip

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Parsing HTML with xml.etree in Python 2.7? Skip Montanaro <skip.montanaro@gmail.com> - 2015-10-05 10:15 -0500

csiph-web