Hey, the arguments that you pass to a spider are turned into attributes in
your Spider object. In your case, *test* and *secondtest* become attributes
of your spider.

Check the example below. If you don't pass the *msg *parameter to this
spider, it's going to print "hello!" in the output. Otherwise, it prints
the value you've passed.


import scrapy


class MySpider(scrapy.Spider):

   name = 'myspider'

   msg = 'hello!'

   start_urls = ['http://scrapy.org']

   def parse(self, response):
       print self.msg

-- 
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to