-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add DirbotItem to items.py so that genspider creates a valid spider
- Loading branch information
Showing
4 changed files
with
29 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
from scrapy.item import Item, Field | ||
|
||
class Website(Item): | ||
|
||
class DirbotItem(Item): | ||
|
||
name = Field() | ||
url = Field() | ||
description = Field() | ||
|
||
|
||
class Website(DirbotItem): | ||
|
||
url = Field() | ||
|
||
def __str__(self): | ||
return "Website: name=%s url=%s" % (self['name'], self['url']) | ||
return "Website: name=%s url=%s" % (self.get('name'), self.get('url')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,3 @@ | |
USER_AGENT = '%s/%s' % (BOT_NAME, BOT_VERSION) | ||
|
||
ITEM_PIPELINES = ['dirbot.pipelines.FilterWordsPipeline'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters