0

Is it possible to change settings of spider during the spider run? I tried to chenge it but I recieved error e.g.:

In [4]: settings.set('SPIDER_MODULES', ['a'])
TypeError: Trying to modify an immutable Settings object

In [5]: settings.update('SPIDER_MODULES', ['a'])
TypeError: Trying to modify an immutable Settings object
dorinand
  • 1,135
  • 1
  • 13
  • 40
  • What is the use case here? What setting you want to change and why? – Tarun Lalwani Apr 21 '18 at 09:43
  • I would like to download pictures but not in one directory. So i have hash of picture e.g. 123456abcd. So I would like to save it under /1234/567. So I would like to change save directory for each file before it is downloaded. – dorinand Apr 21 '18 at 09:46
  • 1
    Check this: https://stackoverflow.com/questions/27386509/how-to-download-scrapy-images-in-to-a-dynamic-folder – Adrian Apr 21 '18 at 10:09

0 Answers0