All info including error message , spider code , middleware code are inserted in the document pasted in the link below. The code works perfectly when the middleware is disabled. Upon enabling the middleware it throws an error. https://drive.google.com/file/d/1VW-jWKZ0yUG65RGcHNNpEfsJdwq1hpjh/view?usp=sharing Using Scrapy==2.12.0 and Python 3.13.2 Continue reading...