diff --git "a/\347\254\254\344\272\214\347\211\210/Cha 7 -Scrapy\347\210\254\350\231\253\346\241\206\346\236\266/blogSpider/blogSpider/spiders/santostang.py" "b/\347\254\254\344\272\214\347\211\210/Cha 7 -Scrapy\347\210\254\350\231\253\346\241\206\346\236\266/blogSpider/blogSpider/spiders/santostang.py" index 89da697..7718009 100644 --- "a/\347\254\254\344\272\214\347\211\210/Cha 7 -Scrapy\347\210\254\350\231\253\346\241\206\346\236\266/blogSpider/blogSpider/spiders/santostang.py" +++ "b/\347\254\254\344\272\214\347\211\210/Cha 7 -Scrapy\347\210\254\350\231\253\346\241\206\346\236\266/blogSpider/blogSpider/spiders/santostang.py" @@ -18,6 +18,7 @@ def parse(self, response): # soup = BeautifulSoup(response.text, "lxml") # first_title = soup.find("h1", class_= "post-title").a.text.strip() # print ("第一篇文章的标题是:", first_title) + # title_list=soup.find_all("h1", class_= "post-title") # for i in range(len(title_list)): # title = title_list[i].a.text.strip() # print('第 %s 篇文章的标题是:%s' %(i+1, title)) @@ -26,7 +27,7 @@ def parse(self, response): # soup = BeautifulSoup(response.text, "lxml") # first_title = soup.find("h1", class_= "post-title").a.text.strip() # print ("第一篇文章的标题是:", first_title) - + # title_list=soup.find_all("h1", class_= "post-title") # for i in range(len(title_list)): # title = title_list[i].a.text.strip() # print('第 %s 篇文章的标题是:%s' %(i+1, title)) @@ -54,4 +55,4 @@ def parse2(self, response): content = content.replace("\n", " ") item["content"] = content #返回item,交给item pipeline - yield item \ No newline at end of file + yield item