import requests murl='http://www.baidu.com' #返回服务器响应对象 mreponse=requests.get(murl) #手工修改响应对象编制 mreponse.encoding='uft-8' #服务器响应对象编码 mencoding=mreponse.encoding print(f"响应对象编码:{mencoding}") #从响应对象中获取内容 mtext=mreponse.text print(mtext)
import requests murl='http://www.baidu.com' #返回服务器响应对象 mreponse=requests.get(murl) #手工修改响应对象编制 mreponse.encoding='uft-8' #服务器响应对象编码 mencoding=mreponse.encoding print(f"响应对象编码:{mencoding}") #从响应对象中获取内容 mtext=mreponse.text print(mtext)