From 0629dba8c8c32a8843a915b84095bf54b9f3a675 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 6 Feb 2023 09:18:18 -0500 Subject: [PATCH] Update articles.py This change reflects a change to Wikipedia's html structure. Old Wikipedia page: ```

Title

``` I Old Wikipedia page:: ```

Title

``` --- Chapter05_Scrapy/wikiSpider/wikiSpider/articles.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Chapter05_Scrapy/wikiSpider/wikiSpider/articles.py b/Chapter05_Scrapy/wikiSpider/wikiSpider/articles.py index 40132c8..da48e72 100644 --- a/Chapter05_Scrapy/wikiSpider/wikiSpider/articles.py +++ b/Chapter05_Scrapy/wikiSpider/wikiSpider/articles.py @@ -9,7 +9,7 @@ class ArticleSpider(CrawlSpider): def parse_items(self, response): url = response.url - title = response.css('h1::text').extract_first() + title = response.css('h1 span::text').extract_first() text = response.xpath('//div[@id="mw-content-text"]//text()').extract() lastUpdated = response.css('li#footer-info-lastmod::text').extract_first() lastUpdated = lastUpdated.replace('This page was last edited on ', '')