Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHow get executed javascript #67
Closed
Labels
Comments
|
If you have this script as-is on the page then, unfortunately, no. It's like in a browser - you also cannot get the result of such an evaluation. |
|
@FlorianRappl |
|
From the README: var numEntries = document.ExecuteScript("document.querySelectorAll('div').length");Does that help? Note: The one above only works if you end with an expression, i.e., something that evaluates to a value. If you know already what variable is used, e.g., taking your example above, you could just append Example: // assumes there is only one script element on the apge
var scriptContent = document.QuerySelector("script").TextContent;
// assumes that the variable we are interested in is called "result"
var result = document.ExecuteScript($"{scriptContent}; result"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For example there is some code like this in some website:
<script> var test=12; var test1="num"; var result = test + "/" + test1; </script>is there a way to get value of result after page loaded completely?
in this code : "12/num"