I want to get pictures from a website on a regular basis. However, the program needs to run in the background. I managed to get load the page and all, but i need a way to save the pictures found on this page. Can anyone help me??
Printable View
I want to get pictures from a website on a regular basis. However, the program needs to run in the background. I managed to get load the page and all, but i need a way to save the pictures found on this page. Can anyone help me??
to download a single picture you can do this
put an inet control on a form...
------------------Code:Dim localFile As String
Dim strURL As String
Dim b() As Byte
localFile = "c:\mark.jpg"
strURL = "http://graffiti.virgin.net/dms.mbs/images/mark.jpg"
' Retrieve the file as a byte array.
b() = Inet1.OpenURL(strURL, icByteArray)
Open localFile For Binary Access _
Write As #1
Put #1, , b()
Close #1
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
Thanx for the help. I appreciate it. Another q. Is it possible to get the filenames of pictures, if you don't have them? I was thinking of reading the HTML file into a string (or sumptin') and the searching for .jpg and .gif extensions. But this way, i'll get buttons, and banners and stuff too. :(
That is the way to do it, you could ignore most banner by checking for the default width/height of them, width="468" height="60
------------------
Vincent van den Braken
EMail: [email protected]
ICQ: 15440110
Homepage: http://www.azzmodan.demon.nl
to search for pictures you could parse the file looking for img tags but if you want to grab backbrounds as well (no img tag there) you could parse the hypertext backwards and search for fig. or gpj. etc
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
To parse for img tags, take a look at http://www.vbsquare.com/tips/tip174.html
------------------
"To the glory of God!"