2012-11-30 42 views
0

我想解析一些包含flash播放器的网页,并使用urllib2接收页面HTML。用urllib2解析包含flash的网页

此网页使用jwplayer,我需要从网页中获取的数据位于Flash Object标记内。看起来像这样:

<object width="100%" height="100%" type="application/x-shockwave-flash" data="https://salsalessons.tv/wp-content/themes/bstrap/js/jwplayer/player.swf" bgcolor="#000000" id="jwplayer-1" name="jwplayer-1" tabindex="0"> 
    <param name="allowfullscreen" value="true"> 
    <param name="allowscriptaccess" value="always"> 
    <param name="seamlesstabbing" value="true"> 
    <param name="wmode" value="opaque"> 
    <param name="flashvars" value="SomeValues"> 
</object> 

和我需要的数据是这些参数标签之一的值。问题是,urllib2的下载页面,如果它没有闪存installes,得到这个代码,而不是在上面应该已经来了:

<div id="jwplayer-1"> 
<a href="http://get.adobe.com/flashplayer/">Get Adobe Flash Player</a> to watch this video. 
</div> 

我能做些什么,这样的urllib2将下载页面,就好像它安装了Flash Player吗?

谢谢。

回答