示例#1
0
        static async Task Scrape()
		{
            Console.Out.WriteLine("Starting...");

            var client = new HttpClientWrapper();

            var scraper = new ListingPageScraper(client, new Uri("http://www.wegottickets.com/searchresults/page/0/latest"));

		    ListingPage concertListings = await scraper.Scrape();

		    foreach (var listing in concertListings.Uris)
		    {
		        var concertPageScraper = new ConcertPageScraper(client, listing);

		        var concert = await concertPageScraper.Scrape();

                Console.Out.WriteLine($"{concert.Artist} playing at {concert.City} {concert.Venue}, on {concert.Date}. Tickets for {concert.Price}.");
		    }

            return;
		}
示例#2
0
        static async Task Scrape()
        {
            Console.Out.WriteLine("Starting...");

            var client = new HttpClientWrapper();

            var scraper = new ListingPageScraper(client, new Uri("http://www.wegottickets.com/searchresults/page/0/latest"));

            ListingPage concertListings = await scraper.Scrape();

            foreach (var listing in concertListings.Uris)
            {
                var concertPageScraper = new ConcertPageScraper(client, listing);

                var concert = await concertPageScraper.Scrape();

                Console.Out.WriteLine($"{concert.Artist} playing at {concert.City} {concert.Venue}, on {concert.Date}. Tickets for {concert.Price}.");
            }

            return;
        }