'Way to show difference between initial load / after fetching from sources

I'm looking for a way (in general - for each and every case) or a tool, which gives me the possibility to check for differences between what was loaded initially and what was loaded afterwards (fetched from other resources, manipulated via scripts etc). I'm only trying to address computed events which are made as the document loads, not what the user changes afterwards by interacting with the site.

Use case: I need to query a large site, with multiple elements that behave a dependency (content-wise) on values that are fetches from databases etc, with XPath. XPath itself does not find non-static content (by content I mean elements).

I read this answer and it helped me understand how XPath can be used with content that is not initially/static available, but I don't quite get this part:

If you want to know how I figured out which request and which script was populating that response tag, well that I did using firebug, searching for SHOW_CNT inside all of the responses that involve calling to your URL, which pointed to the request I specified, and then trying to check who was requesting that.

tl:dr - is there a way to (not just for a specific case searching the source code) show differences between initial document load and the modified document after all resources are fetched and everything is manipulated?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source