示例#1
0
 public WebResponse(IWebUri webUri, IRepeat repeat, IRequest request, ITranslateResponse translateResponse)
 {
     WebUri            = webUri;
     Repeat            = repeat;
     Request           = request;
     TranslateResponse = translateResponse;
 }
示例#2
0
        public static IWebResponse Create(IWebUri webUri, IRepeat repeat = null, IRequest request = null, ITranslateResponse translateResponse = null)
        {
            var requestLocal           = request ?? new Request(webUri);
            var repeatLocal            = repeat ?? new Repeat(requestLocal);
            var translateResponseLocal = translateResponse ?? new HtmlDocTranslateResponse();

            return(new WebResponse(webUri, repeatLocal, requestLocal, translateResponseLocal));
        }
示例#3
0
        public void Process(HtmlDocument htmlDoc, IWebUri webUri)
        {
            SearchRows = new List <SearchRowModel>();

            var lis = GetLisSubDetails(htmlDoc);

            foreach (var li in lis)
            {
                var subDetailWebSites = CreateSubDetailsList();

                foreach (var subDetail in subDetailWebSites)
                {
                    subDetail.Process(li, webUri);
                }


                if (TryCreateModel(subDetailWebSites, out var model))
                {
                    SearchRows.Add(model);
                }
            }
        }
示例#4
0
        public void Process(HtmlDocument htmlDoc, IWebUri webUri)
        {
            var span = htmlDoc.DocumentNode.SelectSingleNode("//span[@itemprop='timeRequired']");

            Duration = span?.GetAttributes("data-duration")?.FirstOrDefault()?.Value;
        }
示例#5
0
 public HtmlDocWebSite(IWebUri webUri, IWebResponse webResponse = null)
 {
     this.webUri      = webUri;
     this.webResponse = webResponse ?? WebResponseBuilder.Create(webUri);
 }
 public void Process(HtmlNode htmlNode, IWebUri webUri)
 {
     Title = htmlNode.SelectSingleNode(".//h2[@class='filmPreview__title']")?.InnerHtml;
 }
示例#7
0
        public void Process(HtmlDocument htmlDoc, IWebUri webUri)
        {
            var div = htmlDoc.DocumentNode.SelectSingleNode("//div[@itemprop='genre']");

            Genre = div.InnerText;
        }
示例#8
0
        public void Process(HtmlDocument htmlDoc, IWebUri webUri)
        {
            var h1 = htmlDoc.DocumentNode.SelectSingleNode("//h1[contains(@class,'filmCoverSection__title')]");

            Title = h1?.InnerText;
        }
示例#9
0
        public void Process(HtmlDocument htmlDoc, IWebUri webUri)
        {
            var a = htmlDoc.DocumentNode.SelectSingleNode("//a[@itemprop='director']");

            Directior = a?.InnerText?.Trim();
        }
示例#10
0
 public void Process(HtmlNode htmlNode, IWebUri webUri)
 {
     Year = htmlNode.SelectSingleNode(".//div[@class='filmPreview__year']")?.InnerText;
 }
示例#11
0
 public void Process(HtmlNode htmlNode, IWebUri webUri)
 {
     Release = htmlNode.SelectSingleNode(".//div[@class='filmPreview__release']")?.GetAttributes("data-release")?.FirstOrDefault()?.Value;
 }
 public void Process(HtmlNode htmlNode, IWebUri webUri)
 {
     Duration = htmlNode.SelectSingleNode(".//div[@class='filmPreview__filmTime']")?.GetAttributes("data-duration")?.FirstOrDefault()?.Value;
 }
示例#13
0
 public Request(IWebUri uri)
 {
     this.uri = uri;
 }
示例#14
0
 public void Process(HtmlNode htmlNode, IWebUri webUri)
 {
     Link = webUri.Host + htmlNode.SelectSingleNode(".//a[@class='filmPreview__link']")?.GetAttributes("href")?.FirstOrDefault()?.Value;
 }
示例#15
0
        public void Process(HtmlDocument htmlDoc, IWebUri webUri)
        {
            var span = htmlDoc.DocumentNode.SelectSingleNode("//span[@itemprop='ratingValue']");

            Rating = span?.InnerText?.Trim();
        }