From e12b689c4f399e44e7b5ab9df989dfc8ac79023e Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 16 Jul 2013 14:26:53 -0400 Subject: [PATCH 1/2] Updated documentation of spider arguments to include required super call. --- docs/topics/spiders.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst index 4e969498d..3174efd52 100644 --- a/docs/topics/spiders.rst +++ b/docs/topics/spiders.rst @@ -61,9 +61,10 @@ Spiders receive arguments in their constructors:: class MySpider(BaseSpider): name = 'myspider' - def __init__(self, category=None): + def __init__(self, category=None, *args, **kwargs): self.start_urls = ['http://www.example.com/categories/%s' % category] # ... + super(MySpider, self).__init__(*args, **kwargs) Spider arguments can also be passed through the Scrapyd ``schedule.json`` API. See `Scrapyd documentation`_. From 1ca31244b087d1d15b25456e644d40e62d247847 Mon Sep 17 00:00:00 2001 From: Dan Date: Tue, 16 Jul 2013 14:50:10 -0400 Subject: [PATCH 2/2] Fixed ordering of super argument call. --- docs/topics/spiders.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/topics/spiders.rst b/docs/topics/spiders.rst index 3174efd52..6586db668 100644 --- a/docs/topics/spiders.rst +++ b/docs/topics/spiders.rst @@ -62,9 +62,9 @@ Spiders receive arguments in their constructors:: name = 'myspider' def __init__(self, category=None, *args, **kwargs): + super(MySpider, self).__init__(*args, **kwargs) self.start_urls = ['http://www.example.com/categories/%s' % category] # ... - super(MySpider, self).__init__(*args, **kwargs) Spider arguments can also be passed through the Scrapyd ``schedule.json`` API. See `Scrapyd documentation`_.