MCPcopy
hub / github.com/scrapy/scrapy / __iter__

Method __iter__

scrapy/utils/sitemap.py:51–60  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

49 self.type = self._get_tag_name(root)
50
51 def __iter__(self) -> Iterator[dict[str, Any]]:
52 for event, elem in self.xmliter:
53 if event == "start":
54 continue
55
56 if self._get_tag_name(elem) not in {"url", "sitemap"}:
57 continue
58
59 if d := self._process_sitemap_element(elem):
60 yield d
61
62 def _process_sitemap_element(
63 self, elem: lxml.etree._Element

Callers

nothing calls this directly

Calls 2

_get_tag_nameMethod · 0.95

Tested by

no test coverage detected