Python_54之requests模块

requests模块 发送http请求  (用python模拟浏览器,爬虫用)

import requests
rslut=requests.get("http://www.weather.com.cn/data/sk/101110101.html") #发送请求
rslut.encoding="utf-8"
rss=rslut.text
print (rss)
输出——————————————————————————————————————————————————————————————————

{"weatherinfo":{"city":"西安","cityid":"101110101","temp":"20","WD":"西南风","WS":"1级","SD":"14%","WSE":"1","time":"17:00","isRadar":"1","Radar":"JC_RADAR_AZ9290_JB","njd":"暂无实况","qy":"970","rain":"0"}}

 

223

posted on 2018-04-16 17:20  JuGooLar  阅读(123)  评论(0编辑  收藏  举报

导航