[python]リクエストロールバックホットスポット
Timeout
解決策
timeoutパラメータを次のように追加します.
response = requests.get(url, timeout=3)
SSLError
HTTPSConnectionPool(host='www.gov.kr', port=443): Max retries exceeded with url: /portal/service/serviceInfo/PTR000050203 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))
解決策
response = requests.get(url, verify=False)
ハングルエンコーディング割り込みの問題
解決策
utf-8で符号化すればハングルは割れないと思っていたが、そうではなかった.
response = requests.get(url)
content_type = response.headers['content-type']
if not 'charset' in content_type:
response.encoding = response.apparent_encoding
リクエストで解決できない問題については、Seleniumなどを使用してください.Reference
この問題について([python]リクエストロールバックホットスポット), 我々は、より多くの情報をここで見つけました https://velog.io/@somnode/python-requests-크롤링-이슈テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol