public CasperJsHelper.CasperJsHelper GetInstance() { var casper = new CasperJsHelper.CasperJsHelper(@"..\..\casperjs-1.1.3"); casper.ErrorReceived += Casper_ErrorReceived; casper.OutputReceived += Casper_OutputReceived; return(casper); }
static void Main(string[] args) { var currentPath = GetExecutingDirectoryName(); const string jsPath = "Scripts/screenshot.js"; var casperJs = new CasperJsHelper.CasperJsHelper("casperjs-1.1.3"); casperJs.OutputReceived += (sender, e) => { Console.WriteLine(e.Data); }; casperJs.Run(string.Format("{0}/{1}", currentPath, jsPath), new[] { "codeyu", "codeyu.jpg" }); Console.ReadLine(); }