Skip to content

Custom Data Extraction

Combine CSS selectors for structured elements with Lua pattern matching for data hidden in script tags or unstructured text.

name = "Hybrid Extraction"
url = "https://example.com/page"
selector = ".product"
fields = [
"name:h2",
"price:.price"
]
  • ctx.last_fetch.response.body contains the raw HTML
  • Lua patterns (:match()) work like regex for simple extractions
  • after_extract runs on all items at once, good for batch processing
  • You can inject new fields or modify existing ones