如何处理来自显示视频的网页的响应流?
<html>
<body style="background-color: rgb(38,38,38);">
<video controls="" autoplay="" name="media"
style="margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0;"
src="http://av.vimeo.com/32372/157/24910156.mp4?token=1322514534_58acf41d56103820e9fe93763c73fadd">
</video>
</body>
</html>
上面是我输入 URL 时尝试获取的页面响应:
但是,程序只是崩溃了以下代码(即从未显示最终 - 意味着流仍在继续)
我认为除了源之外,它还在流式传输视频 - 我不希望发生这种情况
我如何检索此源?
Dim final As String = ""
Dim request1 As HttpWebRequest = DirectCast(WebRequest.Create(urlvimeohd), HttpWebRequest)
request1.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"
Dim response1 As HttpWebResponse = DirectCast(request1.GetResponse(), HttpWebResponse)
final = New StreamReader(response1.GetResponseStream).ReadToEnd
MessageBox.Show(final)
我只想要网页的来源。当我尝试 webbrowser1.navigate
时,消息来源只是说“技术困难”。我该如何继续?
<html>
<body style="background-color: rgb(38,38,38);">
<video controls="" autoplay="" name="media"
style="margin: auto; position: absolute; top: 0; right: 0; bottom: 0; left: 0;"
src="http://av.vimeo.com/32372/157/24910156.mp4?token=1322514534_58acf41d56103820e9fe93763c73fadd">
</video>
</body>
</html>
Above is the response of the page I am trying to get if I enter the URL:
However, the program just crashes with the following code (i.e. never even displays final - meaning stream is still going on)
I think that it is streaming the video, in addition to the source- which I do not want to happen
How can I retrieve this source?
Dim final As String = ""
Dim request1 As HttpWebRequest = DirectCast(WebRequest.Create(urlvimeohd), HttpWebRequest)
request1.UserAgent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 Safari/535.1"
Dim response1 As HttpWebResponse = DirectCast(request1.GetResponse(), HttpWebResponse)
final = New StreamReader(response1.GetResponseStream).ReadToEnd
MessageBox.Show(final)
I just want the source of the webpage. When I try webbrowser1.navigate
, the source just says "technical difficulties". How can I proceed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将 URL 替换为您的链接
replace Url with your link