Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21839

how to get src=" " value from webbrowser controle source code ?

$
0
0
hi all. i am loading a web page in webbrowser controle . I want to extract the value of src="" from the source code. I used the following code to get value of href="" successfully but dont know how to get value of src=""!
i hope some one show me how to get that value src="" .


Note: there are few src "" in the source code but i am only
intrested in src="" value that has play.php?mediaid= on it

HTML Code:

<TD width="430" bgcolor="#000000" align="center" valign="top"><IFRAME src="http://www.somesite.com/videoplayer/player.php?mediaID=12345" width="430" height="348" marginwidth="0" marginheight="0"  hspace="0" vspace="0" scrolling="no" frameborder="0" ></IFRAME></TD>
                                                                                        </TR>
                                                                                        <TR>


Code:

Private Sub Command5_Click()
Dim doc As HTMLDocument
Dim aHref As HTMLAnchorElement

Set doc = WebBrowser2.Document

For Each aHref In WebBrowser2.Document.All.tags("A")

'MsgBox aHref.href
If InStr(aHref.href, "player.php?mediaID=") Then
List2.AddItem aHref.href
End If
Next aHref

End Sub

Viewing all articles
Browse latest Browse all 21839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>