当前位置: 首页>>代码示例>>C#>>正文


C# DOM.GetTableByHeader方法代码示例

本文整理汇总了C#中DOM.GetTableByHeader方法的典型用法代码示例。如果您正苦于以下问题:C# DOM.GetTableByHeader方法的具体用法?C# DOM.GetTableByHeader怎么用?C# DOM.GetTableByHeader使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DOM的用法示例。


在下文中一共展示了DOM.GetTableByHeader方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PopulateMatchDetails

    private void PopulateMatchDetails(Match match)
    {
        DOM Document = new DOM("http://svenskfotboll.se/ovriga-serier/information/?widget=1&scr=result&fmid=" + match.ID);

            var DetailRows = Document.Query("table[@id='iMatchInfo']//tr");
            match.Venue = DetailRows.GetCellValueByFirstColumn("Spelplats");
            match.Referee = DetailRows.GetCellValueByFirstColumn("Domare");
            match.AssistingReferee1 = DetailRows.GetCellValueByFirstColumn("Ass. domare 1");
            match.AssistingReferee2 = DetailRows.GetCellValueByFirstColumn("Ass. domare 2");

            if (match.Venue != "")
            {
                var VenueLocation = GeoCoder.GeoCodeAddress(match.Venue);
                if (VenueLocation != null)
                {
                    match.VenueLongitude = VenueLocation.Longitude;
                    match.VenueLatitude = VenueLocation.Latitude;
                }
            }

            var Logotypes = Document.Query("table[@class='clTblMatch']//img");

            if (Logotypes.Count > 1)
            {
                match.Team1Logo = "http://svenskfotboll.se" + Logotypes[0].GetAttributeValue("src");
                match.Team2Logo = "http://svenskfotboll.se" + Logotypes[1].GetAttributeValue("src");

                match.Team1Logo = match.Team1Logo.Replace("/width_125", "");
                match.Team2Logo = match.Team1Logo.Replace("/width_125", "");
            }

            var PlayerTables = Document.GetTableByHeader("Laguppställning");
            var SecondaryPlayerTables = Document.GetTableByHeader("Ersättare");

            if (PlayerTables.Count > 1)
            {
                match.Team1Players = GetPlayers(PlayerTables[0]);
                match.Team2Players = GetPlayers(PlayerTables[1]);
            }

            if (SecondaryPlayerTables.Count > 1)
            {
                match.Team1SecondaryPlayers = GetPlayers(SecondaryPlayerTables[0]);
                match.Team2SecondaryPlayers = GetPlayers(SecondaryPlayerTables[1]);
            }

            // To not flood their server
            System.Threading.Thread.Sleep(200);
    }
开发者ID:robcar,项目名称:getingarna,代码行数:49,代码来源:SoccerAPI.cs


注:本文中的DOM.GetTableByHeader方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。