private static string GetTitle(HtmlDocument html)
{
var titleText = string.Empty;
var title = html.DocumentNode.SelectSingleNode("//title");
if (title != null)
{
titleText = title.InnerText;
if (!string.IsNullOrWhiteSpace(titleText))
{
titleText = HttpUtility.HtmlDecode(titleText);
}
}
return titleText;
}