1.blogSummary.xpath(‘normalize-space(.//div/div[2]/div[1]/text())’).extract()[0]
normalize-space()//解决的是有多余空格的问题,normalize-space是用来去除\r\t\n的
2.response2.status,取返回的状态码
3.data1 = blogSummary.xpath(".//div[@class=‘article_tit newtit’]/h3/a")
title = “”.join(data1.xpath(‘string(.)’).extract())# 这个方法用来提取被标签包围的文本信息
4.newsdata = re.sub(r’\s+’, ‘’, newsdata),匹配的是去除空格
5.time_data = re.findall(r’发表于\s+(\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2})’, response2.text)匹配时间格式