Html Agility Pack 抓取搜狗微信搜索时部分内容无法获取

例如抓主页中的阅读量 class=s1span,无法获取此节点,而s2的则无内容。
请问这是什么问题呢?如何解决?谢谢。

HtmlWeb web = new HtmlWeb();
            HtmlDocument doc = web.Load("http://weixin.sogou.com");
            HtmlNode node = doc.GetElementbyId("pc_0_0");//输出node中找不到span_s1节点
            StreamWriter sw = File.CreateText("log.txt");
            foreach (HtmlNode child in node.ChildNodes)
            {
                if (child.Name != "li")
                    continue;
                HtmlNode hn = HtmlNode.CreateNode(child.OuterHtml);
                
                Write(sw, String.Format("公众号:{0}", hn.SelectSingleNode("//*[@class=\"account\"]").InnerText));
                Write(sw, String.Format("地址:{0}", hn.SelectSingleNode("//*[@class=\"account\"]").Attributes["href"].Value));
                Write(sw, String.Format("标题:{0}", hn.SelectSingleNode("//h3").InnerText));
                Write(sw, String.Format("地址:{0}", hn.SelectSingleNode("//h3").SelectSingleNode("//a").Attributes["href"].Value));
                Write(sw, String.Format("缩略图:{0}", hn.SelectSingleNode("//*[@class=\"img-box\"]").SelectSingleNode("//img").Attributes["src"].Value));
                //Write(sw, String.Format("阅读量:{0}", hn.SelectSingleNode("//*[@class=\"s1\"]").InnerText)); //节点找不到
                Write(sw, String.Format("简介:{0}", hn.SelectSingleNode("//*[@class=\"txt-info\"]").InnerText));
            }
            sw.Close();
            Console.ReadLine();
阅读 1.5k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进