こんにちは、私は現在スクレイピーを使用していますが、クロールを実行すると、拒否ルールが完全に無視され、同じアイテムが複数スクレイピングされることに気付きました。理由を教えてください。どんな助けでも大歓迎です
class DIY_spider(CrawlSpider):
name = 'diy_cat'
allowed_domains = ['diy.com']
start_urls =[
#"http://www.diy.com",
"http://www.diy.com/nav/decor",
"http://www.diy.com/nav/garden",
"http://www.diy.com/nav/rooms",
"http://www.diy.com/nav/fix",
"http://www.diy.com/nav/build",
]
rules = (
Rule(SgmlLinkExtractor(allow=(r'/nav/decor|garden|rooms|fix|build/([A-Za-z0-9-]*)$'),
deny=('//diy/jsp/',
'pricerange',
'productId',
'-size%',
'tab=rev')),follow=True),
Rule(SgmlLinkExtractor(allow=(r'/nav/decor|garden|rooms|fix|build/(.*)[0-9]{8}$' ),)
, follow=True, callback='parse_items'),
** * ** * ** * ** * ** *編集* ** * ** * ** * ** * ** *
ここにログから何が起こっているかがあります
2014-04-07 15:01:47+0100 [diy_cat] デバッグ: <200 からスクレイピングhttp://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec -1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712?height=411&mediaId=m8416757&productId=13538712&skuId=14009418&width=411 >
{'currency_code': 'GBP',
'supplier_name': 'www.diy.com',
'supplier_part_description': u'19mm tongue and groove interlocking timber to side walls, 12mm tongue and groove timber to floor and roof, supplied with pressure treated floor joists and green roofing felt.',
'supplier_part_name': u'Shire 11x8 Berryfield Log Cabin - Home Delivered Only',
'supplier_part_number': u'5019804112289',
'supplier_price_gross': 1249.98,
'supplier_price_net': 1041.65,
'supplier_price_tax_amount': 208.33,
'supplier_url': 'http://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec-1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712'}
2014-04-07 15:01:47+0100 [diy_cat] デバッグ: <200 からスクレイピングhttp://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec -1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712?height=411&mediaId=m8416844&productId=13538712&skuId=14009418&width=411 >
{'currency_code': 'GBP',
'supplier_name': 'www.diy.com',
'supplier_part_description': u'19mm tongue and groove interlocking timber to side walls, 12mm tongue and groove timber to floor and roof, supplied with pressure treated floor joists and green roofing felt.',
'supplier_part_name': u'Shire 11x8 Berryfield Log Cabin - Home Delivered Only',
'supplier_part_number': u'5019804112289',
'supplier_price_gross': 1249.98,
'supplier_price_net': 1041.65,
'supplier_price_tax_amount': 208.33,
'supplier_url': 'http://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec-1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712'}
2014-04-07 15:01:47+0100 [diy_cat] デバッグ: <200 からスクレイピングhttp://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec -1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712?height=411&mediaId=m8417696&productId=13538712&skuId=14009418&width=411 >
{'currency_code': 'GBP',
'supplier_name': 'www.diy.com',
'supplier_part_description': u'19mm tongue and groove interlocking timber to side walls, 12mm tongue and groove timber to floor and roof, supplied with pressure treated floor joists and green roofing felt.',
'supplier_part_name': u'Shire 11x8 Berryfield Log Cabin - Home Delivered Only',
'supplier_part_number': u'5019804112289',
'supplier_price_gross': 1249.98,
'supplier_price_net': 1041.65,
'supplier_price_tax_amount': 208.33,
'supplier_url': 'http://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec-1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712'}
2014-04-07 15:01:47+0100 [diy_cat] デバッグ: <200 からスクレイピングhttp://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec -1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712?heroPopup=true&mediaId=m8417696&productId=13538712&skuId=14009418 >
{'currency_code': 'GBP',
'supplier_name': 'www.diy.com',
'supplier_part_description': u'19mm tongue and groove interlocking timber to side walls, 12mm tongue and groove timber to floor and roof, supplied with pressure treated floor joists and green roofing felt.',
'supplier_part_name': u'Shire 11x8 Berryfield Log Cabin - Home Delivered Only',
'supplier_part_number': u'5019804112289',
'supplier_price_gross': 1249.98,
'supplier_price_net': 1041.65,
'supplier_price_tax_amount': 208.33,
'supplier_url': 'http://www.diy.com/nav/garden/garden-buildings/cabins-summerhouses/-constructiontype-Interlocking/-pricerangec-1200-1300/-size%3E3_29_x_2_39m/Shire-11x8-Berryfield-Log-Cabin-Home-Delivered-Only-13538712'}