<p>In the WCF application that I am working on, I need to access the generated source of a particular webpage (after all the AJAX calls on the page are made).</p>

<p>I have tried using <code>System.Net.WebRequest</code> but it just brings me back the original source of the page. Is there a way to execute a page and then get the source?</p>

<p>Else, is there a way to execute Javascript from within a WCF service? I could use the javascript and JSON response to create the HTML page from within my webservice then!</p>

[{'answer_id': 70852, 'author': 'cruizer', 'author_id': 6441, 'author_profile': 'https://Stackoverflow.com/users/6441', 'pm_score': 0, 'selected': False, 'text': '<p>Well, WCF is designed to be consumed by non-browsers, so there really is no way to expect that a WCF response can contain Javascript that will be automatically executed by the client.</p>\n'}, {'answer_id': 73876, 'author': 'Petar Vucetin', 'author_id': 10424, 'author_profile': 'https://Stackoverflow.com/users/10424', 'pm_score': 1, 'selected': False, 'text': '<p>You could use Javascript to traverse and pass the DOM than make a call into your WCF service from the Javascript when all the Ajax calls are complete. If you are after the data that is stored on the page after all the Ajax calls I would re-think your implementation...</p>\n\n<p>Petar</p>\n'}, {'answer_id': 74308, 'author': 'Adhip Gupta', 'author_id': 384, 'author_profile': 'https://Stackoverflow.com/users/384', 'pm_score': 0, 'selected': False, 'text': '<p>@Petar: Thanks for your input. Yes, I am after that data that will be stored in the page after the Ajax calls. And, somehow the third party vendor will not give me that data via some JSON calls which I could directly call from my own WCF service.</p>\n'}]
['https://Stackoverflow.com/questions/70685', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/384/']