清洁数据用scrapy刮掉

时间:2017-05-22 15:39:38

标签: python web-scraping scrapy

我使用scrapy在python 3.6中构建了几个scraper。

但是,我经常会收到奇怪的符号,例如Â中的混乱数据。我还会返回整个标语而不是文本。例如。这个:

  

h3 class =“matrix-heading short clear-hide”Â/ h3,h3   class =“matrix-heading clear-hide”Â/ h3,h3 class =“matrix-heading   漫长的“51周

已从此代码返回:

response.xpath('//div/section/div/h3/text()').extract()

我不明白为什么它会返回整个标语,因为它只返回scrapy shell中的文本。

0 个答案:

没有答案
相关问题