[Python-de] Http download as text
Gerhard Häring
haering_python at gmx.de
Wed Jun 26 11:10:35 EDT 2002
* Josef Cihal <josef.cihal at irm.at> [2002-06-26 08:20 +0200]:
> WWW-Anfänger Frage:
>
> Wie kann ich bitte eine www Seite herunterladen als Plain/Text mit
> Hilfe von Python.
>
> Mit httplib habe ich nur geschaft die Seite als HTTP Code herunterlagen,
> aber ich brauche nur Text?
Das hat mit Python nichts zu tun. Was du dazu brauchst, ist ein
Konverter von html nach text. Die ueblichen Textmode-Browser lynx, w3m
und links koennen das mittels eines Parameters -dump, z. B:
lynx -dump http://foo.bar.com/baaz/ >textfile.txt
Selberbauen ginge evtl. mittels sgmllib, XML-Libraries, ... davon wuerde
ich aber wg. besser Alternativen abraten.
HTH,
Gerhard
--
This sig powered by Python!
Außentemperatur in München: 20.1 °C Wind: 4.2 m/s
More information about the Python-de
mailing list