Crawly.Pipelines.CSVEncoder (Crawly v0.17.0) View Source

Encodes a given item (map) into CSV. Does not flatten nested maps.

Options

If no fields are given, the item is dropped from the pipeline.

  • :fields, required: The fields to extract out from the scraped item. Falls back to the global config :item.

Example Usage

iex> item = %{my: "first", other: "second", ignore: "this_field"} iex> Crawly.Pipelines.CSVEncoder.run(item, %{}, fields: [:my, :other]) {"first,second", %{}}