public void GetHtmlTest()
 {
     SpiderTaobao target = new SpiderTaobao(); // TODO: 初始化为适当的值
     string url = "http://s.taobao.com/search?q=%CA%B5%C4%BE+%D7%D4%D3%C9%C3%C5&ex_q=&filterFineness=&atype=&fs=1&commend=all&ssid=s5-e"; // TODO: 初始化为适当的值
     string expected = string.Empty; // TODO: 初始化为适当的值
     string actual;
     actual = target.GetHtml(url);
     Console.WriteLine(actual);
 }
        public void GetDetailForLinkTest()
        {
            SpiderTaobao target = new SpiderTaobao(); // TODO: 初始化为适当的值
            string url = "http://item.taobao.com/item.htm?id=6079437206"; // TODO: 初始化为适当的值
            string html = target.GetHtml(url);
            NodeList result = target.GetDetailPageForHtml(html);

            Console.WriteLine(result.ToHtml());

            NodeList pictures = target.GetPicturesForDetailHtml(result);

            int length = pictures.Count;
            for (int i = 0; i < length; i++)
            {
                Console.WriteLine("{0} , {1}",pictures[0].ToPlainTextString(), pictures[i].ToHtml());
            }

            target.DownloadPictures("products/6079437206/",pictures);

            Console.WriteLine(target.GetDetailForDetailHtml(html));
        }
        public void Init()
        {
            SpiderTaobao target = new SpiderTaobao(); // TODO: 初始化为适当的值
            target.Start();
            NodeList result = target.ItemLink;

            int length = result.Count;
            Console.WriteLine(length);
            for (int i = 0; i < length; i++)
            {
                ATag a = result[i] as ATag;
                Console.WriteLine("{0} , {1}", a.Link, a.ToPlainTextString());
            }
        }
 public void ParserDetailPageTest()
 {
     SpiderTaobao target = new SpiderTaobao(); // TODO: 初始化为适当的值
     string url = "http://item.taobao.com/item.htm?id=6079437206"; // TODO: 初始化为适当的值
     target.ParserDetailPage(url);
 }
 public void InitTest()
 {
     SpiderTaobao target = new SpiderTaobao(); // TODO: 初始化为适当的值
     target.Start();
     Assert.Inconclusive("无法验证不返回值的方法。");
 }
Exemple #6
0
 static void Main(string[] args)
 {
     SpiderTaobao taobao = new SpiderTaobao();
     taobao.Start();
 }