Results 1 to 6 of 6

Thread: [RESOLVED] Get All Images Link from HTML

  1. #1

    Thread Starter
    Addicted Member _RaJ_'s Avatar
    Join Date
    Apr 2008
    Location
    India!
    Posts
    198

    Resolved [RESOLVED] Get All Images Link from HTML

    i wrote this.......

    but when i use debug.print img then it dont show anything in intermediate area

    vb Code:
    1. Public Sub imgTag(theData As String)
    2. Dim I As Long, Z As Long, S As Long, IMG As String
    3. On Error GoTo HeLL
    4. S = 1
    5. Dim DD As String
    6.     For I = 1 To UBound(Split(Text2.Text, "src="))
    7.         S = InStr(S, Text2.Text, "<img src=" & Chr(34))
    8.         Z = InStr(S, Text2.Text, Chr(34))
    9.         IMG = Mid(Text2.Text, S, (Z - Z))
    10.         debug.print IMG
    11.         S = S + 5
    12.     Next
    13. HeLL:
    14.     Exit Sub
    15. End Sub

    ●════════════════════════════◄►═════════════════════════●
    ___itš bεttεг tΘ bε απ Θρεπ šiππεг, thαπ α ƒαlšε šαiπt___
    ●════════════════════════════◄►═════════════════════════●
    гαj

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Get All Images Link from HTML

    Quote Originally Posted by _RaJ_
    vb Code:
    1. On Error GoTo HeLL


    Put something into your error handler. For example:
    Code:
    Debug.Print Err.Number & ", " & Err.Description
    ... to see what's wrong.

  3. #3

    Thread Starter
    Addicted Member _RaJ_'s Avatar
    Join Date
    Apr 2008
    Location
    India!
    Posts
    198

    Re: Get All Images Link from HTML

    nothing is error

    ●════════════════════════════◄►═════════════════════════●
    ___itš bεttεг tΘ bε απ Θρεπ šiππεг, thαπ α ƒαlšε šαiπt___
    ●════════════════════════════◄►═════════════════════════●
    гαj

  4. #4
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: Get All Images Link from HTML

    Try changing
    IMG = Mid(Text2.Text, S, (Z - Z))
    to
    IMG = Mid(Text2.Text, S, (Z - S))

  5. #5

    Thread Starter
    Addicted Member _RaJ_'s Avatar
    Join Date
    Apr 2008
    Location
    India!
    Posts
    198

    Re: Get All Images Link from HTML

    Quote Originally Posted by MarkT
    Try changing
    IMG = Mid(Text2.Text, S, (Z - Z))
    to
    IMG = Mid(Text2.Text, S, (Z - S))
    what is the diffrence!!?

    ●════════════════════════════◄►═════════════════════════●
    ___itš bεttεг tΘ bε απ Θρεπ šiππεг, thαπ α ƒαlšε šαiπt___
    ●════════════════════════════◄►═════════════════════════●
    гαj

  6. #6
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: Get All Images Link from HTML

    The last parameter of the mid function is for the number of characters to grab. In the code you posted lets assume that
    S = 52
    Z = 77

    (Z - Z) = 0
    So you are telling the mid function to grab 0 characters.

    (Z- S) 15
    So you are telling the mid function to grab 15 characters.

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