Search code examples
cssjmetercss-selectorsselector

How to extract the inner text of a script tag using JMeter CSS Selector?


I simply added a class ".script_class" to my script tag to find it.

Then my JMeter settings are:

Name of created variable: content
CSS Selector expression: .script_class
Default Value: Not_Found

While other tags like <b> save their inner text in the content variable, it stays empty for the script tag. It doesn't show the default value, so it did get found by my expression.

Is there a way to save the inner text of my script tag into the content variable and then extract it for further use?


Solution

  • I don't think it's possible to do with CSS Selector Extractor, consider switching to XPath Extractor which has text() function:

    enter image description here