Results 1 to 3 of 3

Thread: How to extract multiple values from html pattern?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Red face How to extract multiple values from html pattern?

    Hi all i am using inet1.openURL to output the html code into textbox using code at the button .What i want scan the whole html in the textbox and look for the bold parts below and add them to listview. I be happy if some one show me how i can grab those two data shown in bold.Thanks

    <tr>
    <td align="center" scope="row">1</td>
    <td align="center"><INPUT TYPE="Checkbox" NAME="song_id" ONCLICK="reviewSelection();" VALUE="2206"></td>
    <td><a href="#" class="song_title" onclick="loadPlayer('2206');return false;">song title
    </a> </td>
    <td align="center">&nbsp;</td>
    <td align="center">&nbsp;</td>
    </tr>


    code to get html in textbox:

    VB Code:
    1. Private Sub Command1_Click(Index As Integer)
    2.  
    3. Select Case Index
    4.     Case 0:
    5.         If txtURL.Text <> "" Then
    6.        
    7.    
    8.             RichTextBox1.Text = Inet1.OpenURL(txtURL.Text, icString)
    9.  
    10.         End If
    11.    
    12.     Case 1:
    13.         End
    14. End Select
    15. End Sub

  2. #2
    eltiT resU motsuC Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: How to extract multiple values from html pattern?

    u would have an easier time using the webbrowser control with HTML Object reference


    VB Code:
    1. Dim HTMLA As HTMLAnchorElement
    2.    Dim HTML As HTMLDocument
    3.    Set HTML = webbrowser1.Document
    4.    For Each HTMLA In HTML.links
    5.         If InStr(HTMLA.onclick, "loadPlayer") Then
    6.             tmp = HTMLA.onclick
    7.             tmp = Replace(tmp, "loadPlayer('", "")
    8.             tmp = Replace(tmp, "');return false;", "")
    9.             MsgBox tmp & " - " & HTMLA.innerText
    10.         End If
    11.     Next
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Apr 2005
    Posts
    1,907

    Re: How to extract multiple values from html pattern?

    static could u tell me where should i put this ? i mean in what event ?Furthermore , could u explain to me if i need any controles or refrences or coponents to run it.

    Also could u tell me what u mean by using the webbrowser control ? i am doing lot of pattern search thing simmer to this so i need to learn easy way too. Furthermore, i do not see your code make any connection to listview ? could u show me how to output the matches to listview so i can manipulate them later.Thanks

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