Docs
API 1.39
Status
Fields

sample

The `sample` option of an extract field.

A sample value recorded by the picker, kept as a permanent test of the field's parsing.

Type: object

#Keys

KeyTypeDescription
sample.rawstringThe raw string the page printed, such as 1.299,90 TL.
sample.valueanyThe value the raw string must parse to, such as 1299.9.

#Example

{
  "price": {
    "selector": ".price",
    "type": "money",
    "locale": "tr",
    "currency": "TRY",
    "sample": {
      "raw": "1.299,90 TL",
      "value": 1299.9
    }
  }
}

From the contract fixture product-page-list-regex-json, a program the test suite validates.

Was this page helpful?