Results 1 to 3 of 3

Thread: WebBrowser: For Each *pictures* in ...

  1. #1

    Thread Starter
    Hyperactive Member Krass's Avatar
    Join Date
    Aug 2000
    Location
    Montreal
    Posts
    489

    WebBrowser: For Each *pictures* in ...

    How could I get the listing of all pictures on a webpage, using the WebBrowser control?

    Couldn't find help on the topic.

    Thanks.
    Chris

  2. #2
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Well

    I'd use the Inet control to get the source - and then string parse out the '<img' tag... That'd get you the image listing and image paths...

    Cheers!
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  3. #3
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    You can use the Document Object Model's images collections:
    VB Code:
    1. Dim i As Integer
    2.  
    3. For i = 0 To WebBrowser1.Document.images.length - 1
    4. MsgBox WebBrowser1.Document.images.Item(i).getAttribute("src")
    5. Next
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

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