예제 #1
0
        /// <summary>
        /// 得到指定页面的url
        /// </summary>
        /// <returns></returns>
        public string Browser()
        {
            WebUtil webUtil = new WebUtil(this.url);

            string[] cookiesName = { "seraph.os.cookie" };
            return(webUtil.Browser("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
                                   "text/html;charset=UTF-8", cookiesName));
        }
예제 #2
0
        /// <summary>
        /// 进行数据监视
        /// </summary>
        public void Watch()
        {
            WebUtil webUtil  = new WebUtil(this.watchUrl);
            string  response = webUtil.Browser("text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
                                               "text/html;charset=UTF-8", null);

            HtmlDocument htmlDoc = new HtmlDocument();

            htmlDoc.LoadHtml(response);
            HtmlNode node = htmlDoc.DocumentNode.SelectSingleNode(DATA_XPATH);

            this.watchData = node.InnerHtml.Replace("\r\n", "").Replace(" ", "");
        }