Receives a response and a dict (representing each row) with a key for each provided (or detected) header of the CSV file. This spider also gives the opportunity to override adapt_response and process_results methods for pre and post-processing purposes.
(self, response: Response)
| 140 | raise NotImplementedError |
| 141 | |
| 142 | def parse_rows(self, response: Response) -> Any: |
| 143 | """Receives a response and a dict (representing each row) with a key for |
| 144 | each provided (or detected) header of the CSV file. This spider also |
| 145 | gives the opportunity to override adapt_response and |
| 146 | process_results methods for pre and post-processing purposes. |
| 147 | """ |
| 148 | |
| 149 | for row in csviter( |
| 150 | response, self.delimiter, self.headers, quotechar=self.quotechar |
| 151 | ): |
| 152 | ret = iterate_spider_output(self.parse_row(response, row)) |
| 153 | yield from self.process_results(response, ret) |
| 154 | |
| 155 | def _parse(self, response: Response, **kwargs: Any) -> Any: |
| 156 | if not hasattr(self, "parse_row"): |