0

I'm trying to start my scrapy bot from a Django application and I need to pass in a list of strings and also a list of numbers that the bot requires to function. This is my code in the views.py of my Django application:

task = scrapyd.schedule('default', 'arc', 
            settings=settings, numIds=numIds, formOp=formOp)

numId is the list of the numbers I need to pass and fromOp is the list of strings I need to pass. I tried extracting them in the scrapy spider file using:

kwargs.get('numIds')
kwargs.get('formOp')

for some reason, it only gives me the first number/string in the list even if I try and send a JSON object. is there a way to pass the entire list through scrapyd?

sam rafiei
  • 51
  • 1
  • 6
  • `scrapyd.schedule('default', 'arc', settings=settings, numIds=json.dumps(numIds), formOp=json.dumps(formOp))` does not work? – Umair Ayub Dec 29 '20 at 10:00
  • @UmairAyub This worked, Thank you very much!!! how do I make it so it shows up as the Answer? – sam rafiei Dec 30 '20 at 00:52

0 Answers0