Hi all i have this application that loads html and it needs to search trough all the html and list the numbers between VALUE=" and "></td> .I mean i want to collect bold number :VALUE="3018"></td>.
My program what it does now it outputs like this with some extra things:
but i want it to look like this thisCode:http://localhost/new/player.php?song=,"album.php?show_albums,"3018","3019","3020","3021"
i tried many things i could not remove the extra album.php?show_albums, and extra " from output url . I be happy if some one help me fix these problems.I bolded importent part.ThanksCode:http://localhost/new/player.php?song=3018,3019,3020,3021
Html code hast mane of this type of blocks
VB Code:
<tr> <td align="center" scope="row">1</td> <td align="center"><INPUT TYPE="Checkbox" NAME="song_id" ONCLICK="reviewSelection();" [B]VALUE="[/B]3018[B]"></td>[/B] <td><a href="#" class="song_title" onclick="loadPlayer('3018');return false;"> my life </a> </td> <td align="center"> </td> <td align="center"> </td> </tr>
my code:
VB Code:
Private Sub Command1_Click(Index As Integer) Select Case Index Case 0: If txtURL.Text <> "" Then RichTextBox1.Text = Inet1.OpenURL(txtURL.Text, icString) End If Case 1: End End Select End Sub Private Sub Command2_Click() Dim sResult() As String, n As Long If GetLine(RichTextBox1.Text, "[COLOR=Red]VALUE=[/COLOR]", " [COLOR=Red]></td>[/COLOR] ", sResult) Then ' Occurances were found and have been placed in the array Text1.Text = "http://localhost/new/player.php?song" For n = LBound(sResult) To UBound(sResult) List1.AddItem sResult(n) Text1.Text = Text1.Text & "[COLOR=Red],[/COLOR]" & Split(sResult(n), "=")(1) Next n '--------------- end of making url code Else ' No occurances were found End If End Sub Private Function GetLine(ByVal sText As String, ByVal sStart As String, ByVal sEnd As String, ByRef sArr() As String) As Boolean Dim lPos As Long, lEnd As Long, lCount As Long, sTemp() As String ReDim sTemp(100) lPos = InStr(1, sText, sStart, vbTextCompare) Do While lPos lEnd = InStr(lPos, sText, sEnd, vbTextCompare) If lEnd Then 'Remove & sEnd from the below line. 'sTemp(lCount) = Mid$(sText, lPos, lEnd - lPos) & sEnd sTemp(lCount) = Mid$(sText, lPos, lEnd - lPos) lPos = InStr(lEnd, sText, sStart, vbTextCompare) Else sTemp(lCount) = Mid$(sText, lPos) lPos = 0 End If lCount = lCount + 1 If lCount > UBound(sTemp) Then ReDim Preserve sTemp(100 + lCount) Loop If lCount > 0 Then ReDim Preserve sTemp(lCount - 1) sArr = sTemp End If GetLine = lCount End Function




Reply With Quote