(self, response: Response, **kwargs: Any)
| 72 | yield from self.process_results(response, ret) |
| 73 | |
| 74 | def _parse(self, response: Response, **kwargs: Any) -> Any: |
| 75 | if not hasattr(self, class="st">"parse_node"): |
| 76 | raise NotConfigured( |
| 77 | class="st">"You must define parse_node method in order to scrape this XML feed" |
| 78 | ) |
| 79 | |
| 80 | response = self.adapt_response(response) |
| 81 | nodes: Iterable[Selector] |
| 82 | if self.iterator == class="st">"iternodes": |
| 83 | nodes = self._iternodes(response) |
| 84 | elif self.iterator == class="st">"xml": |
| 85 | if not isinstance(response, TextResponse): |
| 86 | raise ValueError(class="st">"Response content isn&class="cm">#x27;t text") |
| 87 | selector = Selector(response, type=class="st">"xml") |
| 88 | self._register_namespaces(selector) |
| 89 | nodes = selector.xpath(fclass="st">"//{self.itertag}") |
| 90 | elif self.iterator == class="st">"html": |
| 91 | if not isinstance(response, TextResponse): |
| 92 | raise ValueError(class="st">"Response content isn&class="cm">#x27;t text") |
| 93 | selector = Selector(response, type=class="st">"html") |
| 94 | self._register_namespaces(selector) |
| 95 | nodes = selector.xpath(fclass="st">"//{self.itertag}") |
| 96 | else: |
| 97 | raise NotSupported(class="st">"Unsupported node iterator") |
| 98 | |
| 99 | return self.parse_nodes(response, nodes) |
| 100 | |
| 101 | def _iternodes(self, response: Response) -> Iterable[Selector]: |
| 102 | for node in xmliter_lxml(response, self.itertag): |
nothing calls this directly
no test coverage detected