Python Web Scraping Cookbook
上QQ阅读APP看书,第一时间看更新

Determining the type of content for a URL 

When performing a GET requests for content from a web server, the web server will return a number of headers, one of which identities the type of the content from the perspective of the web server.  In this recipe we learn to use that to determine what the web server considers the type of the content.