-
-
Save CelestialMusa/9d2142a7f68180b5426823264c40693f to your computer and use it in GitHub Desktop.
Revisions
-
DotNetNerd revised this gist
May 23, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ public string Grab(string url) WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, UseShellExecute = false, RedirectStandardOutput = true, FileName = Config.PhantomJSPath, Arguments = string.Format("\"{0}\\{1}\" {2}", Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName, "index.js", url) }; -
DotNetNerd created this gist
May 23, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ class Program { static void Main(string[] args) { var grabby = new Grabby(); string output = grabby.Grab("http://www.dotnetnerd.dk/cv"); Console.WriteLine(output); File.WriteAllText("c:\\test.html", output); } } public class Grabby { public string Grab(string url) { var process = new System.Diagnostics.Process(); var startInfo = new System.Diagnostics.ProcessStartInfo { WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden, UseShellExecute = false, RedirectStandardOutput = true, FileName = "C:\\Users\\chn\\Desktop\\phantomjs-1.9.0-windows\\phantomjs", Arguments = string.Format("\"{0}\\{1}\" {2}", Directory.GetParent(Directory.GetCurrentDirectory()).Parent.FullName, "index.js", url) }; process.StartInfo = startInfo; process.Start(); string output = process.StandardOutput.ReadToEnd(); process.WaitForExit(); return output; } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ var page = require('webpage').create(), system = require('system'); page.onLoadFinished = function() { console.log(page.content); phantom.exit(); }; page.open(system.args[1]);