updated chinaz_spider

This commit is contained in:
Marvin Zhang
2019-05-22 23:10:33 +08:00
parent 3c1d3a65ea
commit 8406f06522

View File

@@ -50,7 +50,10 @@ class ChinazSpiderSpider(scrapy.Spider):
# location info extraction
res2 = arr[1].css('a::text').extract()
location = res2[0]
if len(res2) > 0:
location = res2[0]
else:
location = '其他'
# assign values to item
item['main_category'] = main_category