0

I'm writing a web crawler for statistic purposes. The website dynamically updates through javascript. I managed to parse the HTML file and copy all script values into an array. How do i re-execute these scripts locally or on-the-fly in order to get the return values? CsQuery, Jint or other method?

  • Depending on your goals (i.e. implement full .Net-only browser vs. scraping dynamic pages) using PhantomJS or embedded browser (i.e. built in [WebBrowserControl](http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx) or similar controls on the other engines) may be easier. – Alexei Levenkov Mar 24 '13 at 20:13

1 Answers1

2

CsQuery is a complete DOM manipulation library for .NET. While it is awesome, it can not "re-execute" scripts. That would require an actual JavaScript interpreter (like Jint).

If you need to actually simulate a browser for getting AJAX responses and that sort of stuff, I've personally had a lot of success with Selenium.

Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504