Is it possible to download only the <head> of a web page?

Rex rex.eastbourne at gmail.com
Thu Sep 4 23:33:38 CEST 2008


I am writing a script that executes a bunch of queries through a form
on a website and reads the results. I am only interested in the
<title> section in the <head> of each web page. Currently, each page
the server returns is about 100kb and contains a bunch of HTML and
Javascript, all of which I don't need; I don't want to waste bandwidth
or consume too much of the server's resources. I just need the <title>
string.

Is there any way to download less than the entire web page?



More information about the Python-list mailing list