MCPcopy
hub / github.com/scrapy/scrapy / export_item

Method export_item

scrapy/exporters.py:120–123  ·  view source on GitHub ↗
(self, item: Any)

Source from the content-addressed store, hash-verified

118 self.encoder: JSONEncoder = ScrapyJSONEncoder(**self._kwargs)
119
120 def export_item(self, item: Any) -> None:
121 itemdict = dict(self._get_serialized_fields(item))
122 data = self.encoder.encode(itemdict) + "\n"
123 self.file.write(to_bytes(data, self.encoding))
124
125
126class JsonItemExporter(BaseItemExporter):

Callers

nothing calls this directly

Calls 3

to_bytesFunction · 0.90
writeMethod · 0.45

Tested by

no test coverage detected