json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig)
有一次爬虫遇到了json的字符串响应对象
然后转为json对象
报这个错误
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0) 意思是叫你用utf-8-sig编码
response.encoding = 'utf-8-sig'
强转json成功。