It's so easy. Use dropitem in pipelines.py to drop the item. And you can use custom command to code the parameter inside of program.
Here is example of custom code in scrapy
Using the custom command (say : scrapy crawl mycommand)
you can run -s JOBDIR=crawls/somespider-1
Example:
Create a directory commands where you have scrapy.cfg file
Inside the directory create a file mycommand.py
from scrapy.command import ScrapyCommand
from scrapy.cmdline import execute
class Command(ScrapyCommand):
requires_project = True
def short_desc(self):
return "This is your custom command"
def run(self, args, opts):
args.append('scrapy')
args.append('crawl')
args.append('spider')##add what ever your syntax needs.In my case i want to get "scrapy crawl spider" in cmd
execute(args)#send a list as parameter with command as a single element of it
Now go to cmd line and type scrapy mycommand. Then your magic is ready :-)