H
Harlin Seritt
Is there any way to fetch a website's host/version headers using
Python?
Thanks,
Harlin
Python?
Thanks,
Harlin
Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_python/3.1.3Python?>>> import httplib
>>> conn = httplib.HTTPConnection("docs.python.org")
>>> conn.connect()
>>> conn.request("HEAD", "/")
>>> response = dict([(k.lower(), v) for k,v in conn.getresponse()])
>>> conn.close()
>>> server = response["server"]
>>> print server
Apache/2.0.54 (Debian GNU/Linux) DAV/2 SVN/1.1.4 mod_python/3.1.3Python?import httplib
conn = httplib.HTTPConnection("docs.python.org")
conn.connect()
conn.request("HEAD", "/")
response = dict([(k.lower(), v) for k,v in conn.getresponse()])
conn.close()
server = response["server"]
print server
Python/2.3.5 mod_ssl/2.0.54 OpenSSL/0.9.7e
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.