Skip to content

1.4.0: Placeholder transformer

Latest
Compare
Choose a tag to compare
@esafirm esafirm released this 29 May 02:44
· 18 commits to master since this release
bdc452f

With PlaceholderTransformer you can achieve more dynamic query

val page = Page("https://twitter.com/{{USERNAME}}/likes") {
  query("td {{TAG}}") {
    "title" to text()
  }
}

val transformer = PlaceholderTransformer(mapOf(
  "USERNAME" to "esafirm",
  "TAG" to "a"
))

// {{USERNAME}} will be replaced by "esafirm" and {{TAG}} with "a"
val transformedPage = transformer.transform(page)