How does node crawler detect whether a section of js in a page has been executed

  node.js, question

I want to write a crawler. The page js is executed by electron (similar to the implementation of nightmarejs, which plays the role of phantomjs)
There was an img in the page, and its src value will be changed by js.
I want to get the changed value
How do I know if the code that changed src value has been executed, and if img shows a new picture

There was a paragraph like this

<img src="...">
 <script>
 // change img src
 </script>

I want to get the modified img binary data

No, your crawler only retrieves an html unless you run a PhantomJS