MCPcopy
hub / github.com/scrapy/scrapy / _evaluate_iterable

Method _evaluate_iterable

scrapy/core/spidermw.py:100–114  ·  view source on GitHub ↗
(
        self,
        response: Response,
        iterable: AsyncIterator[_T],
        exception_processor_index: int,
        recover_to: MutableAsyncChain[_T],
    )

Source from the content-addressed store, hash-verified

98 return await scrape_func(response, request)
99
100 async def _evaluate_iterable(
101 self,
102 response: Response,
103 iterable: AsyncIterator[_T],
104 exception_processor_index: int,
105 recover_to: MutableAsyncChain[_T],
106 ) -> AsyncIterator[_T]:
107 try:
108 async for r in iterable:
109 yield r
110 except Exception as ex:
111 exception_result: MutableAsyncChain[_T] = self._process_spider_exception(
112 response, ex, exception_processor_index
113 )
114 recover_to.extend(exception_result)
115
116 def _process_spider_exception(
117 self,

Callers 2

Calls 2

extendMethod · 0.45

Tested by

no test coverage detected