我正在尝试解析一些包含 Flash 播放器的网页并使用 urllib2 接收页面 HTML。
此网页使用 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 下载页面,就好像它没有安装闪存一样,获取此代码而不是上面应该出现的地方:
<div id="jwplayer-1">
<a href="http://get.adobe.com/flashplayer/">Get Adobe Flash Player</a> to watch this video.
</div>
我该怎么做才能让 urllib2 像安装了 Flash Player 一样下载该页面?
谢谢。