static public HtmlDocument GetCustomPage() { if (_customPage == null) { _customPage = RequestSender.GetRequestPage(_customPageUrl); } return(_customPage); }
static public HtmlDocument GetGenrePageHtml() { var genrePageUrl = ConfigsMain.GetDomen() + "/g"; if (_genrePage == null) { _genrePage = RequestSender.GetRequestPage(genrePageUrl); } return(_genrePage); }
public List <Book> GetBookList() { var doc = RequestSender.GetRequestPage(_siteUrl); var htmlBooksPage = doc.DocumentNode.SelectNodes(_bookLocator); var resultBooks = new List <Book>(); foreach (var node in htmlBooksPage) { resultBooks.Add(new Book(node.InnerText, node.GetAttributeValue("href", "error"))); } return(resultBooks); }
public string GetBookAnotation(string url) { var bookUri = _siteDomen + url; var doc = RequestSender.GetRequestPage(bookUri); var node = doc.DocumentNode.SelectSingleNode(_bookAnotationLocator); if (node == null) { return(_blankAnnotationString); } else { return(node.InnerText); } }
public Image LoadBookImage(string url) { var bookUri = _siteDomen + url; var doc = RequestSender.GetRequestPage(bookUri); var node = doc.DocumentNode.SelectSingleNode(_imageLocator); if (node == null) { return(RequestSender.GetImageStub()); } else { var imageUrl = node.GetAttributeValue("src", "error"); imageUrl = _siteDomen + imageUrl; return(RequestSender.LoadImageFromUrl(imageUrl)); } }