Exercice 10 - vérificateur de liens
#!/usr/bin/python
# -*- coding: ISO-8859-15 -*-
import urllib2
import sys
def checkurl(url):
req = urllib2.Request(url)
try:
url_handle = urllib2.urlopen(req)
except urllib2.URLError?:
return None, None
headers = url_handle.info()
return headers['Content-Type']?, headers['Date']?
Backlinks
|
|