mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-26 12:03:40 +00:00
adapted project template to use the new Link Extractors location
This commit is contained in:
parent
64d9155572
commit
75cf903e24
@ -2,7 +2,7 @@
|
||||
import re
|
||||
|
||||
from scrapy.xpath import HtmlXPathSelector
|
||||
from scrapy.link.extractors import RegexLinkExtractor
|
||||
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
|
||||
from scrapy.contrib.spiders import CrawlSpider, Rule
|
||||
from $project_name.items import ${ProjectName}Item
|
||||
|
||||
@ -11,7 +11,7 @@ class $classname(CrawlSpider):
|
||||
start_urls = ['http://www.$site/']
|
||||
|
||||
rules = (
|
||||
Rule(RegexLinkExtractor(allow=(r'Items/', )), 'parse_item', follow=True),
|
||||
Rule(SgmlLinkExtractor(allow=(r'Items/', )), 'parse_item', follow=True),
|
||||
)
|
||||
|
||||
def parse_item(self, response):
|
||||
|
Loading…
x
Reference in New Issue
Block a user