/// <summary> /// Get album's page /// </summary> /// <returns>Parsed album's page</returns> public AlbumResult GetFullAlbum() { WebDownloader downloader = new WebDownloader(AlbumUrl); string content = downloader.DownloadData(); return(WebContentParser.Parse <AlbumResult>(content)); }
/// <summary> /// Get album's page async /// </summary> /// <returns>Parsed album's page</returns> public async Task <AlbumResult> GetFullAlbumAsync() { WebDownloader downloader = new WebDownloader(AlbumUrl); string content = await downloader.DownloadDataAsync(); return(WebContentParser.Parse <AlbumResult>(content)); }
/// <summary> /// Get band's page async /// </summary> /// <returns>Parsed band's page</returns> public async Task <BandResult> GetFullBandAsync() { WebDownloader downloader = new WebDownloader(BandUrl); string content = await downloader.DownloadDataAsync(); return(WebContentParser.Parse <BandResult>(content)); }
/// <summary> /// Get band's page /// </summary> /// <returns>Parsed band's page</returns> public BandResult GetFullBand() { WebDownloader downloader = new WebDownloader(BandUrl); string content = downloader.DownloadData(); return(WebContentParser.Parse <BandResult>(content)); }
public void WebsiteParserModelGeneric() { string html = WebsiteParser.Tests.Properties.Resources.SongContent; var result = WebContentParser.Parse <AlbumModel>(html); Assert.AreEqual(8, result.Songs.Count()); }
public void WebsiteParserModel() { string html = WebsiteParser.Tests.Properties.Resources.SongContent; AlbumModel result = (AlbumModel)WebContentParser.Parse(typeof(AlbumModel), html); Assert.AreEqual(8, result.Songs.Count()); }
private Metadata GetMetadata(string resource) { HtmlDocument document = new HtmlDocument(); document.LoadHtml(resource); string html = document.DocumentNode.QuerySelector("#auditTrail").InnerHtml; return(WebContentParser.Parse <Metadata>(html)); }
public object GetValue(HtmlNode rootNode, out bool canParse) { canParse = true; if (!string.IsNullOrEmpty(Selector)) { rootNode = rootNode.QuerySelector(Selector); if (rootNode == null) { if (!SkipIfNotFound) { throw new ElementNotFoundException(Selector); } canParse = false; } } return(WebContentParser.Parse(PropertyType, rootNode.InnerHtml)); }
private BandResult GetBand(string resource) { return(WebContentParser.Parse <BandResult>(resource)); }
private AlbumResult GetAlbum(string resource) { return(WebContentParser.Parse <AlbumResult>(resource)); }