|
-
Jun 5th, 2010, 12:23 PM
#1
Re: Grab Links from Webpage/HTML source
vb Code:
Dim X As Long, Y As Long
Dim sHtml As String
sHtml = LCase$(Text1.Text) 'cast to lower case
X = InStr(sHtml, "[img]")
Do While X
X = X + Len("[img]")
Y = InStr(X, sHtml, "[")
If X > 0 And Y > 0 Then
Debug.Print Mid$(sHtml, X, Y - X)
Else
Exit Do
End If
X = InStr(Y, sHtml, "[img]")
Loop
'returns
'http://images.com/thumbs/atob3iji.jpg
'http://images.com/images/atob3iji.jpg
Bon Appétit!
Last edited by FireXtol; Jun 5th, 2010 at 12:51 PM.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Jun 5th, 2010, 12:29 PM
#2
Thread Starter
Lively Member
Re: Grab Links from Webpage/HTML source
 Originally Posted by FireXtol
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.
-
Jun 5th, 2010, 12:53 PM
#3
Re: Grab Links from Webpage/HTML source
 Originally Posted by _-Rs-_
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.
Software I use and highly recommend: Opera, Miranda IM, Peerblock, Winamp, Unlocker Assistant, JoyToKey, Virtual CloneDrive, Secunia PSI, ExplorerXP, GOM Player, Real Alternative, Quicktime Alternative,Sumatra PDF, and non-freeware: Photoshop and VB6( ).
My codebank: AllRGB, Rounded Rectangle(math), Binary Server, Buddy Paint, LoadPictureGDI+, System GUID/Volume Serial, HexToAsc, List all processes and their paths, quasiString matching
Strings(search, extraction, retrieval etc): Retrieve BBCode Link from HTML, RemoveBetween ()'s, strFindBetween(str1,str2), Insert text in HTML, HTML - GetSpanByID
-
Jun 5th, 2010, 01:16 PM
#4
Thread Starter
Lively Member
Re: Grab Links from Webpage/HTML source
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|