后端通过python爬取的微信公众号的文章,发现文章里面的视频播放不了,视频是嵌套iframe里,列如:
<iframe class="video_iframe" data-vidtype="2" allowfullscreen="" frameborder="0" data-ratio="0.5660377358490566" data-w="480" scrolling="no" style="display: none; overflow: hidden; width: 337px !important; height: 252.75px !important;" width="337" height="252.75" data-vh="252.75" data-vw="337" data-src="http://v.qq.com/iframe/player.html?vid=w0531e3wcme&width=337&height=252.75&auto=0"></iframe>
然后后端通过正则将data-src成功替换成了src,并成功保存到数据库,可当访问的时候,src并没有。求解答
全部将data-src属性替换为src就可以了