I am using HtmlAgilityPack to read a parse a html file and extract some text:
static void Main(string[] args)
{
var webGet = new HtmlWeb();
var document = webGet.Load("http://port.ro/");
var programs = from program in document.DocumentNode.Descendants()
where program.Name == "a" && program.Attributes["href"] != null && program.InnerText.Trim().Length > 0
select program.InnerText ;
foreach (string s in programs)
{
Console.WriteLine(s);
}
Console.ReadLine();
}
My problem is that the website contains characters like à
and when I print them, they are replaced by ?
.
What should I need to do so when I print the text the character à
its replaced by a
or print it like à
?