En Thu, 09 Apr 2009 07:13:08 -0300, S.Selvam
escribió:
I want to read headers from web page and check whether its Content-Type
is
xml or not.I used the following code
...
request = urllib2.Request(url, None, USER_AGENT)
opener = urllib2.build_opener()
datastream = opener.open(request)
Hi all,
I want to read headers from web page and check whether its Content-Type is
xml or not.I used the following code
...
request = urllib2.Request(url, None, USER_AGENT)
opener = urllib2.build_opener()
datastream = opener.open(request)
if datastream.headers.get('Content-Type','').find('xml