Scrap a picture

  • Thread starter Thread starter Micke Palm
  • Start date Start date
M

Micke Palm

Hi there!

I want to scrap a jpeg picture from another domain and save it on the
server.
Do anyone have any good ideas how I can do that?? I've success to get it
with webscrapping but in someway I cant save it to the disk.

Any fine example or hints are nice to get...

/regards, micke
 
Micke Palm said:
Hi there!

I want to scrap a jpeg picture from another domain and save it on the
server.
Do anyone have any good ideas how I can do that?? I've success to get it
with webscrapping but in someway I cant save it to the disk.

Any fine example or hints are nice to get...

/regards, micke

What do you mean you "get it" with webscrapping?
 
I get some parts of the source from the picture, but it's not complete.
I guess it depends on how I get it. I use streamreader to read the website
now ,but maybet I should use anything else??
This scrapping function works for me when I scrap a html site or aspx site,
but not with a jpeg source.

Example:
Private Function readHtmlPage(ByVal URL As String) As String

Dim result As String

Dim objResponse As System.Net.WebResponse

Dim objRequest As System.Net.WebRequest =
System.Net.HttpWebRequest.Create(URL)

Dim sr As System.IO.StreamReader

'Dim sr As System.IO.BinaryReader

objResponse = objRequest.GetResponse()

sr = New System.IO.StreamReader(objResponse.GetResponseStream())

'sr = New System.IO.BinaryReader(objResponse.GetResponseStream())

result = sr.ReadToEnd()

sr.Close()



readHtmlPage = result

End Function

/Micke
 
Back
Top