ねえ、私はここでこのコードを使用しています:
'WebBrowser1.Navigate("http://0000.org/icampus")
'Do Until Me.WebBrowser1.ReadyState = WebBrowserReadyState.Complete
' Application.DoEvents()
'Loop
'Dim tmpHTML As String = WebBrowser1.Document.Body.InnerHtml
Dim theWidth As Integer = 500 '1920
Dim theHeight As Integer = 500 '1080
Dim doc As New HtmlDocument()
doc.Load("C:\kathryn\fp.html")
'doc.LoadHtml(tmpHTML)
Dim theVidURL As String = doc.DocumentNode.SelectSingleNode("//OBJECT/PARAM[@NAME='Movie']").Attributes("VALUE").Value
この HTML ソースで映画の URL を見つけるには:
<DIV id=player-wrapper>
<DIV id=lcm_video>
<OBJECT id=player codeBase="http://0000.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=480 align=middle height=320 VIEWASTEXT><PARAM NAME="_cx" VALUE="12700"><PARAM NAME="_cy" VALUE="8466"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="http://0000.lightcastmedia.com/lcplayer_flash112fix.swf?autoStart=1&hidecontrols=1&&noresize=1&file=http%3A%2F%2F%2Fedge2%2F3157%2F070712b&rtmppath=rtmp%3A//chi02.live.lightcastmedia.com%3A1935/mc/_definst_&rtmpfile=fvc/3157/070712b&sec=447"><PARAM NAME="Src" VALUE="http://0000.lightcastmedia.com/lcplayer_flash112fix.swf?autoStart=1&hidecontrols=1&&noresize=1&file=http%3A%2F%2F%2Fedge2%2F3157%2F070712b&rtmppath=rtmp%3A//chi02.live.lightcastmedia.com%3A1935/mc/_definst_&rtmpfile=fvc/3157/070712b&sec=447"><PARAM NAME="WMode" VALUE="Window"><PARAM NAME="Play" VALUE="-1"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE=""><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="sameDomain"><PARAM NAME="Scale" VALUE="ShowAll"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE="000000"><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="true"><PARAM NAME="AllowFullScreenInteractive" VALUE="false">
<embed src="http://0000.lightcastmedia.com/lcplayer_flash112fix.swf?autoStart=1&hidecontrols=1&&noresize=1&file=http%3A%2F%2F%2Fedge2%2F3157%2F070712b&rtmppath=rtmp%3A//chi02.live.lightcastmedia.com%3A1935/mc/_definst_&rtmpfile=fvc/3157/070712b&sec=447" quality="best" FlashVars="" bgcolor="#000000" width="480" height="320" name="player" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</OBJECT></DIV>
しかし、何らかの理由で、 theVidURLからNothingが返されますか?
どんな助けでも素晴らしいでしょう!
アップデート
私はこのコードを使用してHTMLを調べました:
Dim theElementCollection As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("PARAM")
For Each curElement As HtmlElement In theElementCollection
If InStr(curElement.GetAttribute("value"), "lightcastmedia.com") <> 0 Then
tmpMovieURL = curElement.GetAttribute("value")
Exit For
End If
Next