Ejemplo n.º 1
0
        private List <NovelGame> ReadGameTable(IHtmlDocument document)
        {
            var games = document.QuerySelectorAll("tr")
                        .Skip(1)
                        .Select(element =>
            {
                var td = element.GetElementsByTagName("td");

                NovelGame game = new NovelGame()
                {
                    Id      = ElementParser.ParseInt(td[0]),
                    Title   = td[1].TextContent,
                    Kana    = td[2].TextContent,
                    SellDay = DateTime.Parse(td[3].TextContent),
                    BrandId = ElementParser.ParseInt(td[4]),
                    Median  = ElementParser.ParseInt(td[5]),
                    Stdev   = ElementParser.ParseInt(td[6]),
                    Getchu  = ElementParser.ParseInt(td[14]),
                    OHP     = td[15].TextContent,
                    Model   = td[16].TextContent,
                    Rating  = ElementParser.ParseBool(td[18]),
                    Gyutto  = ElementParser.ParseInt(td[26]),
                    Fanza   = td[27].TextContent
                };

                return(game);
            });

            return(games.ToList());
        }
Ejemplo n.º 2
0
        private List <Brand> ReadBrandTable(IHtmlDocument document)
        {
            var brands = document.QuerySelectorAll("tr")
                         .Skip(1)
                         .Select(element =>
            {
                var td = element.GetElementsByTagName("td");

                Brand brand = new Brand()
                {
                    Id         = ElementParser.ParseInt(td[0]),
                    Name       = td[1].TextContent,
                    Kana       = td[2].TextContent,
                    Maker      = td[3].TextContent,
                    MakerKana  = td[4].TextContent,
                    Url        = td[5].TextContent,
                    Kind       = td[7].TextContent == "CORPORATION" ? MakerType.CORPORATION : MakerType.CIRCLE,
                    Lost       = ElementParser.ParseBool(td[8]),
                    DirectLink = ElementParser.ParseBool(td[9]),
                    Median     = ElementParser.ParseInt(td[10]),
                    Twitter    = td[12].TextContent
                };

                return(brand);
            });

            return(brands.ToList());
        }