0

I have application that displays webpage with url something like https://www.test.com/checkout/reserve/DHrhrzPEC6MepeMoZinxoQD4QvAaevgx7xYDZJtX8azf0_ii_Zv2b2rpiYgToXHP

from this url program copys some images. I am trying to figure out how to get this url into the following code i have where imageUri is that url

using ( WebClient webClient = new WebClient() ) 
{
   using (Stream stream = webClient.OpenRead(imgeUri))
   {
      using (Bitmap bitmap = new Bitmap(stream))
      {
         stream.Flush();
         stream.Close();
         bitmap.Save(saveto);
      }
   }
}

thanks

user1108282
  • 65
  • 5
  • 10

2 Answers2

0

Ok, so you want to screen scrape images from a webpage. That is a very broad subject. To get you started I suggest you look at:

Html Agility Pack or WatiN

Or read this post. Its a bit of a tutorial on how to go about screen scraping:

How do you Screen Scrape?

Community
  • 1
  • 1
saunderl
  • 1,618
  • 2
  • 16
  • 31
0
string url = HttpContext.Current.Request.Url.AbsoluteUri;

This will give you the complete URL of your current page. From there you can parse string in any format you want to use in your program.

emre nevayeshirazi
  • 18,983
  • 12
  • 64
  • 81