I made a console c# application which is supposed to display the html source of a page.
Instead, the console app is showing HtmlAgilityPack.HtmlDocument
.
Can anyone explain to me why that is?
class Program
{
public HtmlDocument read()
{
HtmlWeb htmlWeb = new HtmlWeb();
try
{
HtmlAgilityPack.HtmlDocument document = htmlWeb.Load("http://www.yahoo.com");
return document;
}
catch (Exception e)
{
Console.WriteLine("Error : " + e.ToString());
return null;
}
}
static void Main(string[] args)
{
Program dis = new Program();
string text = Convert.ToString(dis.read());
Console.WriteLine(text);
Console.ReadLine();
}
}