You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Requests with ExecuteJavascriptMiddleware are sent twice #239
Since the ExecuteJavascriptMiddleware handles a response, it's called once a response is received. So, the http client has already sent the request before it reaches the middleware.
My feeling is that the middleware should be able to handle the request before it is handled by something else.
Activity
fadarrizz commentedon Apr 9, 2024
Since the
ExecuteJavascriptMiddlewarehandles a response, it's called once a response is received. So, the http client has already sent the request before it reaches the middleware.My feeling is that the middleware should be able to handle the request before it is handled by something else.
Looking at how Scrapy does this, a downloader middleware can process requests and can return a response. When a response is returned by the middleware, no other request processing is done, only response processing.
https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#scrapy.downloadermiddlewares.DownloaderMiddleware.process_request
@ksassnowski What do you think is a suitable solution for this?