Results 1 to 11 of 11

Thread: [RESOLVED] Grab Links from Webpage

Hybrid View

  1. #1
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    Re: Grab Links from Webpage/HTML source

    vb Code:
    1. Dim X As Long, Y As Long
    2. Dim sHtml As String
    3. sHtml = LCase$(Text1.Text) 'cast to lower case
    4.  
    5. X = InStr(sHtml, "[img]")
    6. Do While X
    7.   X = X + Len("[img]")
    8.   Y = InStr(X, sHtml, "[")
    9.   If X > 0 And Y > 0 Then
    10.     Debug.Print Mid$(sHtml, X, Y - X)
    11.   Else
    12.     Exit Do
    13.   End If
    14.   X = InStr(Y, sHtml, "[img]")
    15. Loop
    16.  
    17. 'returns
    18. 'http://images.com/thumbs/atob3iji.jpg
    19. 'http://images.com/images/atob3iji.jpg

    Bon Appétit!

  2. #2

    Thread Starter
    Lively Member _-Rs-_'s Avatar
    Join Date
    Aug 2009
    Posts
    84

    Re: Grab Links from Webpage/HTML source

    Quote Originally Posted by FireXtol View Post
    I'm not sure why you'd use split....

    Basically, what I suggest is(as far as built-in string procedures):
    • x = Instr(strHtml, "[IMG]") 'get the char location of "[IMG]"(optionally use Y as the start)
    • Ensure: x > 0
    • Add the len("[IMG]") to x
    • let x = that result of addition
    • make y = Instr(x, strHtml, "[") 'find the closing brace, using X as the start
    • Ensure: y > 0
    • Use: strUrl = Mid$(strHtml, x, y - x - 1) to get the URL
    • this process can be repeated specifying Y as the new start location for Instr
    bro i am new leaner i have no idea what you said if you can give me a

    example i wood appreciate it
    Last edited by _-Rs-_; Jun 23rd, 2010 at 08:55 AM.


  3. #3
    Fanatic Member FireXtol's Avatar
    Join Date
    Apr 2010
    Posts
    874

    Re: Grab Links from Webpage/HTML source

    Quote Originally Posted by _-Rs-_ View Post
    bro i am noob new leaner i have no idea what you said if you can give me a

    example i wood appreciate it
    I have modified the post with an example.

  4. #4

    Thread Starter
    Lively Member _-Rs-_'s Avatar
    Join Date
    Aug 2009
    Posts
    84

    Re: Grab Links from Webpage/HTML source

    Quote Originally Posted by FireXtol View Post
    I have modified the post with an example.
    guys thanks for all the help snoop and firextol bro

    that did the trick


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