- Python Web Scraping Cookbook
- Michael Heydt
- 58字
- 2021-06-30 18:44:13
How it works
The .contentype property is implemented as follows:
@property
def contenttype(self):
self.ensure_response()
return self._response.headers['content-type']
The .headers property of the _response object is a dictionary-like class of headers. The content-type key will retrieve the content-type specified by the server. This call to the ensure_response() method simply ensures that the .read() function has been executed.
推薦閱讀
- CorelDRAW X6 中文版圖形設(shè)計(jì)實(shí)戰(zhàn)從入門到精通
- Aptana Studio Beginner's Guide
- 物聯(lián)網(wǎng)+BIM:構(gòu)建數(shù)字孿生的未來
- 計(jì)算機(jī)網(wǎng)絡(luò)與數(shù)據(jù)通信
- 互聯(lián)網(wǎng)基礎(chǔ)資源技術(shù)與應(yīng)用發(fā)展態(tài)勢(shì)(2021—2023)
- Drush User’s Guide
- 區(qū)塊鏈輕松上手:原理、源碼、搭建與應(yīng)用
- Yii Application Development Cookbook(Second Edition)
- 通信十年:擁抱互聯(lián)網(wǎng)
- 4G小基站系統(tǒng)原理、組網(wǎng)及應(yīng)用
- 物聯(lián)網(wǎng)工程概論
- bash網(wǎng)絡(luò)安全運(yùn)維
- 華為HCIA-Datacom認(rèn)證指南
- 精通SEO:100%網(wǎng)站流量提升密碼
- 物聯(lián)網(wǎng)與智慧農(nóng)業(yè)