Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Updated documentation of spider arguments to include required super call.

Dane12b689c4f39
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`_.