How to grab a part of web page?

Fredrik Lundh fredrik at pythonware.com
Tue Jul 9 19:04:26 EDT 2002


"A" <printers at sendme.cz> wrote:
> Is it possible to download only a part of web page?
> Say I need to find out an information about a customer that starts
> at 1500 byte position and ends at 2000 byte position. If the whole
> page has about 100 kb it seems to me waste of time to load all the
> page.

import urllib

file = urllib.urlopen(DATA)
data = file.read(2000)
file.close()

print data[1500:2000]

</F>





More information about the Python-list mailing list