Google News

부분 유료
분류별 BFD | 업데이트됨 a month ago | News, Media
인기

9.9 / 10

지연 시간

769ms

서비스 수준

100%

Health Check

N/A

모든 토론으로 돌아가기

PYTHON BUG CORRECTED: Supported Language & Settings

Rapid account: Theta 45 Com
theta45.com
10 months ago

I tried the python code to get a json list of supported languages.

But I got this error:

UnicodeEncodeError: ‘charmap’ codec can’t encode character ‘\u010c’ in position 209: character maps to <undefined>

THE FIX:

import http.client

conn = http.client.HTTPSConnection(“google-news13.p.rapidapi.com”)

headers = {
‘X-RapidAPI-Key’: “YOUR KEY”
}

conn.request(“GET”, “/languageRegions”, headers=headers)

res = conn.getresponse()
data = res.read().decode(“utf-8”)

print(data.encode(“utf-8”))

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입