mirror of https://github.com/scrapy/scrapy.git
fixed bug and updated old code in googledir example project
This commit is contained in:
parent
bd16d1cd48
commit
91e1e0aff3
|
|
@ -7,7 +7,7 @@ class FilterWordsPipeline(object):
|
|||
# put all words in lowercase
|
||||
words_to_filter = ['politics', 'religion']
|
||||
|
||||
def process_item(self, domain, item):
|
||||
def process_item(self, spider, item):
|
||||
for word in self.words_to_filter:
|
||||
if word in unicode(item['description']).lower():
|
||||
raise DropItem("Contains forbidden word: %s" % word)
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from googledir.items import GoogledirItem
|
|||
class GoogleDirectorySpider(CrawlSpider):
|
||||
|
||||
name = 'directory.google.com'
|
||||
allow_domains = ['directory.google.com']
|
||||
allowed_domains = ['directory.google.com']
|
||||
start_urls = ['http://directory.google.com/']
|
||||
|
||||
rules = (
|
||||
|
|
|
|||
Loading…
Reference in New Issue