Exporter

class scraper_toolkit.components.Exporter.Exporter(data: Union[Parser, dict, List[dict]])[source]

Export data from parsers.

Param:data: The data to export as a Parser object, a dictionary, or a list of dictionaries.
export_to_csv(csv_path: Union[pathlib.Path, pathlib.PurePath, str], encoding: str = 'UTF-8', write_header: bool = True)[source]

Export parsed data to a CSV file.

Parameters:
  • csv_path – Path of the location to save the CSV file.
  • encoding – CSV file encoding. Default is UTF-8.
  • write_header – If true, write a header row to the CSV file using the “name” keys in the provided data.