import scrapy
class kandian(scrapy.Spider):
name = 'kandian'
def start_requests(self):
urls = [
'http://kandian.youth.cn/index/detail?sign=jG7lmryP69yBbN6',
'http://kandian.youth.cn/index/detail?sign=LgQZ4WplQxgDqPr',
]
for url in urls:
yield scrapy.http.Request(url=url,callback=self.parse)
def parse(self, response):
page = response.url.split('=')[-1]
filename = 'kandian-%s.html' % page
with open(filename,'wb+') as f:
f.write(response.body)
#self.log('Saved file %s' & filename)








IT资讯更多
-
因美方禁令,Adobe 将中止委内瑞拉用户账号和服务,且不退款
-
李国庆采访中怒摔水杯:俞渝用阴谋诡计把我赶出了当当
-
谷歌利用GMS狙击华为Mate 30,华为HMS强势崛起
-
如何有效拦截wps、360、qq弹窗广告?只需这几步,永久关闭流氓行为