Friday 28 February 2014

Get the Content-Type of an URL

Hey everybody,
Have you ever tried to get the content type of any website via python, If not try like this. I tried on python terminal.
OR
>>> import urllib
>>> res = urllib.urlopen("https://www.wslb2b.ford.com/login.cgi")
>>> http_message = res.info()
>>> http_message.type
'text/html'
>>> http_message.maintype
'text'
Thanku :)

0 comments:

Post a Comment