Archived
1
0

Added an basic parser class to extend, next step implementing the global function

This commit is contained in:
Jip J. Dekker 2014-03-28 14:43:22 +01:00
parent d91706d6e5
commit 325febe834
2 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,8 @@ from scrapy.utils.project import get_project_settings
def setup_crawler(searchable):
# [TODO] - Initiate all parsers for the different websites and get
# allowed URLs.
spider = FourmiSpider(compound=searchable)
settings = get_project_settings()
crawler = Crawler(settings)

View File

@ -6,10 +6,11 @@ class FourmiSpider(Spider):
def __init__(self, compound=None, *args, **kwargs):
super(FourmiSpider, self).__init__(*args, **kwargs)
# [TODO] - Initiate all parsers for the different websites and get
# allowed URLs.
def parse(self, reponse):
# [TODO] - This function should delegate it's functionality to other
# parsers.
pass
def add_parser(self, parser):
self.parsers.add(parser)