コード例 #1
0
        public CasperJsHelper.CasperJsHelper GetInstance()
        {
            var casper = new CasperJsHelper.CasperJsHelper(@"..\..\casperjs-1.1.3");

            casper.ErrorReceived  += Casper_ErrorReceived;
            casper.OutputReceived += Casper_OutputReceived;
            return(casper);
        }
コード例 #2
0
        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();
        }