py requsets 爬例1

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)

猜你喜欢

转载自blog.csdn.net/program_god1/article/details/80276851
py1
py