Пример #1
0
        private async Task <string> scrapImageUrl(WebPage detailsPage, string eventTitle)
        {
            var imageUrl = "";

            var relativePhotoUrl = detailsPage.Html.CssSelect(".photo").FirstOrDefault()?
                                   .Attributes["href"].Value;

            imageUrl = $"{_kinoAfishaUri}{relativePhotoUrl}";

            var imagePath = await _eventImageScrapper.ScrapImage(imageUrl, eventTitle);

            return(imagePath);
        }
Пример #2
0
        private async Task <string> scrapImageUrl(HtmlNode performanceHtml, string performanceTitle)
        {
            var imageUrl = performanceHtml.CssSelect(".event-info-img ")
                           .FirstOrDefault()?.Attributes["src"].Value;

            if (imageUrl == null)
            {
                imageUrl = performanceHtml.CssSelect(".selection-img-container__img")
                           .FirstOrDefault()?.Attributes["src"].Value;
            }

            var imagePath = await _eventImageScrapper.ScrapImage(imageUrl, performanceTitle);

            return(imagePath);
        }