L'analyse HTTP est possible
requests.py
# -*- coding: utf-8 -*-
import requests
r = requests.get('http://qiita.com/')
print r.status_code
# 200
print r.headers['content-type']
# text/html; charset=utf-8
print r.encoding
# utf-8
print r.text.encode('utf-8')
# <!DOCTYPE html><html...
Recommended Posts