Skip to Content
PureHTMLdocs

Arrays

Extract collections and lists of elements into JSON arrays.

Basic Array Extraction

Extracting an array is defined using type: array together with an items: sub-configuration. PureHTML queries all matching elements and runs the items configuration against each element:

selector: span
type: array
items: {}

Applying Transformers to Items

You can configure child selectors or transformer pipelines inside the items block:

selector: a
type: array
items:
transform: attr(href)

You can omit type: array if the items property is present in the configuration.

On this page