Extracting href using CSS Selectors on HTML response body text

Hi Community,

id(“io.gatling.gradle”) version “3.13.1”.
Testing UI performance.
Using kotlin.

I’m trying to extract href using CSS selector by following the below guide in Gatling checks scripting reference

But I get this error while running the tests:
11:08:47.003 [ERROR] i.g.c.a.b.SessionHookBuilder$$anon$1 - ‘hook-1’ failed to execute: j.l.ClassCastException: class jodd.lagarto.dom.Element cannot be cast to class java.lang.String (jodd.lagarto.dom.Element is in unnamed module of loader ‘app’; java.lang.String is in module java.base of loader ‘bootstrap’)

.check(
  css("article.more a", "href").ofNode()
)

This is my code:
val search = exec(
http(“Lounge”)
.get(“/PAGE$locale”)
.check(status().shouldBe(200))
.check(css(“.tw-pt-10 a”, “href”).ofNode().findAll().saveAs(“links”))

Hi

css("article.more a", "href").ofNode()

class jodd.lagarto.dom.Element cannot be cast to class java.lang.String

An href attribute is not a DOM tree node, it’s a String leaf. Remove ofNode()