title: Executing page scripts before retrieving it's contents
body: <p>I've a page where i need to automate some tasks and <strong>scrape</strong> some data, but the page runs some JS after loading to inject some data into the DOM; that i cannot intercept (not in a good format anyway), I was hoping to find a solution that is fast and not memory consuming.</p>
  <p>I've attempt to get the scripts myself and execute them using some headless driver (namely phantomJs) but it didn't update the page source and i'm not sure how to retrive the updated DOM from that</p>
  <pre><code>var page = GetWebPage(url);
  var scripts = page.Html.QuerySelectorAll(&quot;script&quot;);
  
  var phantomDriver = new PhantomJSDriver(PhantomJSDriverService.CreateDefaultService(Directory.GetCurrentDirectory()));
  phantomDriver.Navigate().GoToUrl(url);
  
  foreach (var script in scripts)
      phantomDriver.ExecuteScript(script.InnerText);
  
  var at = phantomDriver.PageSource;
  </code></pre>