Archived
1
0

Basic structure to make sure the spider use an argument

This commit is contained in:
Jip J. Dekker 2014-03-18 17:28:49 +01:00
parent 2cb21c6b81
commit 4f5b66fff6
2 changed files with 8 additions and 6 deletions

View File

@ -3,9 +3,10 @@ from scrapy.spider import Spider
class ChemspiderSpider(Spider):
name = "Chemspider"
allowed_domains = ["chemspider.com"]
start_urls = (
'http://www.chemspider.com/',
)
def __init__(self, compound=None, *args, **kwargs):
super(ChemspiderSpider, self).__init__(*args, **kwargs)
self.start_urls = ["http://chemspiderapiurl/something/%s" % compound] #[TODO] - Give an logical start url.
def parse(self, response):
pass

View File

@ -3,9 +3,10 @@ from scrapy.spider import Spider
class WikipediaSpider(Spider):
name = "Wikipedia"
allowed_domains = ["wikipedia.org"]
start_urls = (
'http://www.wikipedia.org/',
)
def __init__(self, compound=None, *args, **kwargs):
super(WikipediaSpider, self).__init__(*args, **kwargs)
self.start_urls = ["http://wikipediaurl/something/%s" % compound] #[TODO] - Give an logical start url.
def parse(self, response):
pass