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 = Config.PhantomJSPath, 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; } }