如果返回的是json內容 可以用requests模塊自帶的 response.json() 直接轉成Python 字典
或者引入json模塊 用json.loads(response.content)
將返回內容 保存到文件里
with open('xxxx.html','wb') as f: f.write(response.content)
返回的內容轉碼 response.decode('utf-8')
如果返回的是json內容 可以用requests模塊自帶的 response.json() 直接轉成Python 字典
或者引入json模塊 用json.loads(response.content)
將返回內容 保存到文件里
with open('xxxx.html','wb') as f: f.write(response.content)
返回的內容轉碼 response.decode('utf-8')
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。