My goal here is to extract the value from a script tag. Unfortunately, when using Selenium, I have been unable to locate the script tag and retrieve the data.
However, with JavaScript, I have found success in accessing the script tag and fetching the value. The script looks something like this:
<script class="payload-script"> Text </script>
$(".payload-script").text();
Now my objective is to execute this script using JavascriptExecutor and store the value in a Java variable for further processing.