private static string GetPageImageUrl(string imageXPath, string pageUrl)
{
var document = WebHelper.GetHtmlDocument(pageUrl);
var img = document.SelectSingleNode(imageXPath);
if (img == null || !img.Attributes.Contains("src"))
{
throw new ParserException("Could not find expected elements on website.", document.InnerHtml);
}
return img.Attributes.First(a => a.Name == "src").Value;
}