I need to get html after all javascripts run.I use WebKit.NET for it and the problem is that WebKitBrowser.StringByEvaluatingJavaScriptFromString doesn't return anything even with simple alert().And when I pass "document.getElementsByTagName('html')[0].outerHTML" (it is actually what I need to get) as the argument it throws the System.AccessViolationException(Attempted to read or write protected memory). And of course I do call StringByEvaluatingJavaScriptFromString in the function that is stick to the DocumentCompleted delegate.I've tried to do the same with WebView in objective-c with the same function StringByEvaluatingJavaScriptFromString and with the same argument "document.getElementsByTagName('html')[0].outerHTML" and it works good as well as it works good with "document.getElementsByTagName('html')[0].outerHTML" in console of the browser. Please help or maybe give alternatives how can I get whole html after runnig all javascripts.
public Form1()
{
InitializeComponent();
webKitBrowser1.Navigate("http://famous-design.ru/stoly/");
webKitBrowser1.DocumentCompleted += webKitBrowser1_DocumentCompleted;
}
void webKitBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
string str = webKitBrowser1.StringByEvaluatingJavaScriptFromString("document.getElementsByTagName('html')[0].outerHTML");
}