data from a web page

Gerhard Häring gerhard.haering at gmx.de
Mon Oct 21 00:32:54 CEST 2002


* Maschio_77 <maschio_77 at hotmail.com> [2002-10-20 22:00 +0000]:
> "bromden" <bromden at gazeta.pl> wrote:
> > what do you exactly mean?
> > [...]
> > - you just want to read a webpage? look here:
> >    http://www.python.org/doc/current/lib/module-httplib.html
> >
> > The first: I want to read the web page content from my little
> > program to take some data

gerhard at gargamel:~$ python
Python 2.2.2 (#1, Oct 18 2002, 03:24:30)
[GCC 2.95.4 20020320 [FreeBSD]] on freebsd4
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> print urllib.urlopen("http://www.python.org/").read()
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<?xml-stylesheet href="./style.css" type="text/css"?>
<html>
[...]

More in the docs about the urllib module.

HTH,

-- Gerhard




More information about the Python-list mailing list