Skip to content
Advertisement

Find a string in Html and get value after

I’m posting to a webpage and in my response I get a big chunk of HTML that will change next request. With groovy I’d like to find this string:

JavaScript

The value “23” will change next time I post to the webpage, and I need that value.

With .contains I’ll find if string exists.

JavaScript

But I need to write out the value after owshiddenversion in the string 'var WPQ1FormCtx = {"ListData":{"owshiddenversion":xxxxx, that can be anything from 1 to 100 000.

Advertisement

Answer

If I understand the string you are matching correctly, this will help you to do it in pure Groovy. You could wrap it in a method that is called as the test instead of .contains()

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement