LoginSignup
0
0

More than 5 years have passed since last update.

めざせpythonライブラリマスター (18)requests

Posted at

【ライブラリ説明】

 HTTP解析ができる

【プログラム】

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...

【参考サイト】

 pypi

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0