def start_requests(self):
for cityid, cityname in cityids.items():
url = 'http://wthrcdn.etouch.cn/weather_mini?citykey=%s' % cityid
yield Request(
url = url,
method = 'GET',
headers = {
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'en-US,en;q=0.5',
'Connection': 'keep-alive',
'Host': 'wthrcdn.etouch.cn',
'Upgrade-Insecure-Requests': '1',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:50.0) Gecko/20100101 '
'Firefox/50.0',
},
meta = {
'cityid': cityid,
'cityname': cityname,
},
callback = self.get_sk_2d_weather,
)
评论列表
文章目录