PDA

Click to See Complete Forum and Search --> : get pictures from webpage


r0ach
Jan 10th, 2000, 05:45 PM
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??

Mark Sreeves
Jan 10th, 2000, 06:41 PM
to download a single picture you can do this
put an inet control on a form...

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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

r0ach
Jan 10th, 2000, 07:57 PM
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. :(

Jan 11th, 2000, 11:40 AM
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: azzmodan@azzmodan.demon.nl
ICQ: 15440110 (http://www.icq.com/15440110)
Homepage: http://www.azzmodan.demon.nl

Mark Sreeves
Jan 13th, 2000, 03:37 PM
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

Mark.Sreeves@Softlab.co.uk
A BMW Group Company

vbsquare
Jan 14th, 2000, 12:13 AM
To parse for img tags, take a look at http://www.vbsquare.com/tips/tip174.html

------------------
"To the glory of God!"