Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TheScraper     scraper  = new TheScraper();
        List <Listing> listings = new List <Listing>();

        // do a loop 4 times, to get all 4 pages.
        for (int i = 0; i < 4; i++)
        {
            listings = listings.Union(scraper.DoTheScrape(i)).ToList();
        }
        string xmlListings = scraper.SerializeTheListings(listings);
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        TheScraper     scraper  = new TheScraper();
        List <Listing> listings = new List <Listing>();

        // quick hack to do a loop 5 times, to get all 5 pages. if this is being run frequently you'd want to automatically identify how many pages or start at page one and find / use link to next page.
        for (int i = 0; i < 5; i++)
        {
            listings = listings.Union(scraper.DoTheScrape(i)).ToList();
        }
        string xmlListings = scraper.SerializeTheListings(listings);
    }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     TheScraper scraper = new TheScraper();
     List<Listing> listings = scraper.DoTheScrape();
     string xmlListings = scraper.SerializeTheListings(listings);