반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- string
- hive
- GIT
- Redshift
- math
- Apache
- Kotlin
- c#
- array
- PostgreSQL
- list
- 파이썬
- matplotlib
- Java
- google apps script
- PANDAS
- django
- Tkinter
- gas
- SQL
- Mac
- PySpark
- Github
- Python
- Excel
- dataframe
- Google Excel
- Google Spreadsheet
- numpy
Archives
- Today
- Total
목록response (1)
달나라 노트
Python : requests response 한글 깨짐 해결, hex string 변환, bytes utf-8 변환, 크롤링 한글 깨짐
WEB을 다루다 보면 API를 호출해서 데이터를 불러올 때가 있는데 이때 아래처럼 내가 받은 데이터가 깨져 보일 때가 있습니다. b'\xc2\xd4\xb5\xa0/\xc6\xdf\xb2\xe2\xb0\xb6\xba\xb5' 맨 앞에 b가 붙었다는 것은 바이트(byte) type의 데이터라는 의미입니다. Encoding을 바꿔주면 해결할 수 있습니다. import requests url = 'https://apihub.kma.go.kr/api/typ01/url/fct_afs_wl.php' params = { 'tmfc1': '2024042200', 'tmfc2': '2024042223', 'mode': '0', 'disp': '1', 'help': '1', 'authKey': 'testauth', } re..
Python/Python Basic
2024. 4. 24. 01:19