Python 웹에서 JSON 가져오기

Jmnote (토론 | 기여)님의 2021년 7월 13일 (화) 02:22 판 (→‎같이 보기)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)

1 개요[ | ]

Python 웹에서 JSON 가져오기
파이썬 인터넷에서 JSON 가져오기

2 예시 1[ | ]

import requests
r = requests.get('https://jsonplaceholder.typicode.com/posts/1')
print( r.status_code )
print( r.headers['content-type'] )
j = r.json()
print( type(j) )
print( j )

3 예시 2[ | ]

import requests
r = requests.get('https://raw.githubusercontent.com/django/django/main/package.json')
print( r.json() )

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}