Skip to content

Instantly share code, notes, and snippets.

@bcatcho
Created May 22, 2012 20:44
Show Gist options
  • Save bcatcho/2771518 to your computer and use it in GitHub Desktop.
Save bcatcho/2771518 to your computer and use it in GitHub Desktop.
public static class HtmlDocumentExtensions
{
public static object ExecuteScript( this HtmlDocument document, string methodName, object[] args )
{
dynamic body = document.NativeElement;
object script = body.document.script;
return script.GetType().InvokeMember( methodName, System.Reflection.BindingFlags.InvokeMethod, null, script, args );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment