Results 1 to 6 of 6

Thread: get pictures from webpage

  1. #1

    Thread Starter
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Post

    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??

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    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

  3. #3

    Thread Starter
    Fanatic Member r0ach's Avatar
    Join Date
    Dec 1999
    Location
    South Africa
    Posts
    722

    Post

    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.

  4. #4
    Guest

    Post

    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




  5. #5
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    Post

    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

  6. #6
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    To parse for img tags, take a look at http://www.vbsquare.com/tips/tip174.html

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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width