Пример #1
0
        private static void GetFargoData()
        {
            HtmlDecoder wc = new HtmlDecoder();

            string       city = "Fargo ND";
            HtmlDocument doc  = null;
            //Console.WriteLine("Getting data for Culture Page 1");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c50-Fargo_North_Dakota.html");
            //GetTextByMultipleClassName(doc, 1, city);

            //Console.WriteLine("Getting data for Outdoors");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c45-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 2, city);

            //Console.WriteLine("Getting data for Landmarks");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c47-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 3, city);

            //Console.WriteLine("Getting data for Museums");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c49-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 4, city);

            //Console.WriteLine("Getting data for Performances");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c43-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 5, city);

            //Console.WriteLine("Getting data for Amusements");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c46-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 6, city);

            //Console.WriteLine("Getting data for Sports");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c44-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 7, city);

            //Console.WriteLine("Getting data for Zoos & Aquariums");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c48-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 8, city);

            //Console.WriteLine("Getting data for Ranch & Farm");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c25-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 15, city);

            //Console.WriteLine("Getting data for Bars");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c20-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 16, city);

            //Console.WriteLine("Getting data for Shopping");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g49785-Activities-c26-Fargo_North_Dakota.html");

            //GetTextByMultipleClassName(doc, 18, city);
        }
Пример #2
0
        public HtmlDocument LoadHtml(string uri)
        {
            string sourceCode;
            var    htmlDocument = new HtmlDocument();

            sourceCode = HtmlDecoder.getSourceCode(uri);
            if (!string.IsNullOrEmpty(sourceCode))
            {
                htmlDocument.LoadHtml("@" + sourceCode); // string containing the HTML content
                return(htmlDocument);
            }
            return(null);
        }
Пример #3
0
        private static void GetSFOData()
        {
            HtmlDecoder wc = new HtmlDecoder();

            string city = "San Fransisco";

            Console.WriteLine("Getting data for Culture Page 1");
            HtmlDocument doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c50-San_Francisco_California.html#TtD");

            GetTextByMultipleClassName(doc, 1, city);

            //Console.WriteLine("Getting data for Culture Page 2");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c50-oa30-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 1, city);

            //Console.WriteLine("Getting data for Culture Page 3");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c50-oa60-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 1, city);

            //Console.WriteLine("Getting data for Culture Page 4");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c50-oa90-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 1, city);

            //Console.WriteLine("Getting data for Outdoors");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c45-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 2, city);

            //Console.WriteLine("Getting data for Landmarks");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c47-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 3, city);

            //Console.WriteLine("Getting data for Museums");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c49-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 4, city);

            //Console.WriteLine("Getting data for Performances");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c43-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 5, city);

            //Console.WriteLine("Getting data for Amusements");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c46-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 6, city);

            //Console.WriteLine("Getting data for Sports");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c44-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 7, city);

            //Console.WriteLine("Getting data for Zoos & Aquariums");
            //doc = wc.LoadHtml(@"http://www.tripadvisor.com/Attractions-g60713-Activities-c48-San_Francisco_California.html#TtD");

            //GetTextByMultipleClassName(doc, 8, city);
        }