- Python Web Scraping Cookbook
- Michael Heydt
- 135字
- 2021-06-30 18:44:13
There's more...
The headers in a response contain a wealth of information. If we look more closely at the headers property of the response, we can see the following headers are returned:
>>> response = urllib.request.urlopen(const.ApodEclipseImage())
>>> for header in response.headers: print(header)
Date
Server
Last-Modified
ETag
Accept-Ranges
Content-Length
Connection
Content-Type
Strict-Transport-Security
And we can see the values for each of these headers.
>>> for header in response.headers: print(header + " ==> " + response.headers[header])
Date ==> Tue, 26 Sep 2017 19:31:41 GMT
Server ==> WebServer/1.0
Last-Modified ==> Thu, 31 Aug 2017 20:26:32 GMT
ETag ==> "547bb44-29c06-5581275ce2b86"
Accept-Ranges ==> bytes
Content-Length ==> 171014
Connection ==> close
Content-Type ==> image/jpeg
Strict-Transport-Security ==> max-age=31536000; includeSubDomains
Many of these we will not examine in this book, but for the unfamiliar it is good to know that they exist.
推薦閱讀
- 網(wǎng)絡(luò)創(chuàng)新指數(shù)研究
- Wireshark網(wǎng)絡(luò)分析就這么簡單
- 雷達(dá)饋線技術(shù)
- Microservice Patterns and Best Practices
- Mastering Dart
- 大型企業(yè)微服務(wù)架構(gòu)實踐與運營
- 5G技術(shù)核心與增強:從R15到R17
- 工業(yè)以太網(wǎng)技術(shù):AFDX/TTE網(wǎng)絡(luò)原理、接口、互連與安全
- 現(xiàn)場綜合化網(wǎng)絡(luò)運營與維護:運營商數(shù)字化轉(zhuǎn)型技術(shù)與實踐
- 移動互聯(lián)網(wǎng)環(huán)境下的核心網(wǎng)剖析及演進
- 一本書讀懂移動物聯(lián)網(wǎng)
- LiveCode Mobile Development Beginner's Guide
- 國外物聯(lián)網(wǎng)透視
- 智能家庭網(wǎng)絡(luò):技術(shù)、標(biāo)準(zhǔn)與應(yīng)用實踐
- Mastering Prezi for Business Presentations