Skip to content

Instantly share code, notes, and snippets.

@mmitou
Created December 14, 2016 11:10
Show Gist options
  • Save mmitou/706319dbae72e8ce016884d840d5573a to your computer and use it in GitHub Desktop.
Save mmitou/706319dbae72e8ce016884d840d5573a to your computer and use it in GitHub Desktop.
RSS取得
description link version
Yahoo! JAPANの天気・災害に掲載されている最新の情報を提供しています。 http://rdsig.yahoo.co.jp/weather/rss/RV=1/RU=aHR0cDovL3dlYXRoZXIueWFob28uY28uanAvd2VhdGhlci9qcC8xNC8- 2.0
import scrapy
class WeatherSpider(scrapy.Spider):
name = "weather"
start_urls = [
'https://rss-weather.yahoo.co.jp/rss/days/4610.xml'
]
def parse(self, response):
yield {
'version' : response.xpath('//rss/@version').extract_first(),
'description' : response.xpath('//rss/channel/description/text()').extract_first(),
'link' : response.xpath('//rss/channel/link/text()').extract_first()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment