Skip to main content
Processors transform extracted values (strip whitespace, cast types, apply regex, etc.).

Available Processors

strip

Remove leading and trailing whitespace

replace

Replace substring in strings

regex

Extract substring using pattern

cast

Convert to specified type

join

Join list values to string

default

Return fallback value if empty

lowercase

Convert strings to lowercase

parse_datetime

Parse datetime to ISO format

Processor Reference

1. strip

Remove leading and trailing whitespace from strings. Parameters: None Example:
Transformation:
Works on: Strings and lists of strings

2. replace

Replace substring in strings. Parameters:
  • old (required): Substring to replace
  • new (required): Replacement string
Example:
Transformation:
Works on: Strings and lists of strings

3. regex

Extract substring using regular expression pattern. Parameters:
  • pattern (required): Regex pattern to match
  • group (optional): Capture group to extract (default: 1)
Example:
Transformation:
Multiple groups:
Returns original value if no match. Works on: Strings only

4. cast

Convert value to specified type. Parameters:
  • to (required): Target type - "int", "float", "bool", or "str"
Example:
Transformations:
Boolean conversion:
  • true, 1, yes, on → True
  • Everything else → False
Returns None if conversion fails. Works on: Any type

5. join

Join list values into a single string. Parameters:
  • separator (optional): String to join with (default: " ")
Example:
Transformation:
Filters out None values automatically. Works on: Lists only

6. default

Return default value if input is None, empty string, or empty list. Parameters:
  • default (required): Fallback value
Example:
Transformations:
Works on: Any type

7. lowercase

Convert strings to lowercase. Parameters: None Example:
Transformation:
Works on: Strings and lists of strings

8. parse_datetime

Parse datetime string into ISO format. Parameters:
  • format (optional): strptime format string (if None, uses dateutil parser for flexible parsing)
Example with format:
Example without format (auto-detect):
Transformations:
Stored as ISO string in database (automatically serialized). Returns None if parsing fails. Works on: Strings only

Processor Chaining

Processors run sequentially. Output of one becomes input to the next.

Example 1: Clean and Convert Price

Example 2: Extract Rating Number

Example 3: Normalize Text

Input: " In Stock "
Output: "in_stock"

Example 4: Handle Missing Values

Common Patterns

Extracting Currency Values

Handles: "$1,299.99", "Price: $99", " $42.50 "

Extracting Numbers from Text

Handles: "23 items", "Quantity: 5", "42"

Boolean Fields

Returns: True if “in stock” or “available”, else False

Date Fields

Auto-detects format, stores as ISO string.

Lists to Comma-Separated String

Input: ["Python", "Web Scraping", "Automation"]
Output: "Python, Web Scraping, Automation"

Complete Examples

E-commerce Product

Job Listing

Real Estate Listing

Error Handling

  • strip, replace, lowercase, join: Return original value if not applicable type
  • regex: Returns original value if no match
  • cast: Returns None if conversion fails
  • parse_datetime: Returns None if parsing fails
  • Unknown processor type: Skipped, logs warning

Best Practices

1

Always strip text fields

2

Use regex before cast

3

Chain replace for complex cleaning

4

Default at the end

5

Test selectors first

6

Validate processor output

Troubleshooting

Processor Returns None

  1. Check processor type - Verify name is correct
  2. Validate input type - regex (strings), join (lists), parse_datetime (strings)
  3. Test without processors - See raw extracted value
  4. Check logs - Look for processor warnings

Wrong Output Type

Add cast processor at the end:

Regex Not Matching

  1. Test pattern - Use regex101.com
  2. Check escaping - Double backslashes in JSON: {"pattern": "\\$([\\d.]+)"}
  3. Add fallback - [{"type": "regex", "pattern": "([\\d.]+)"}, {"type": "default", "default": null}]

Date Parsing Fails

  1. Try without format - {"type": "parse_datetime"} (auto-detect)
  2. Specify format - {"type": "parse_datetime", "format": "%Y-%m-%d"}
  3. Check raw value - View extracted value to understand format

Custom Callbacks

Extract structured data with callbacks

Extractors

Content extraction strategies