【发布时间】:2016-02-17 20:16:34
【问题描述】:
我试图在一个 div 类中抓取一个子数据,我试图在其中获取“url”的数据,我使用了video_link = self.soup.find('div' ,{'class':'video-embed-big'}),但我无法使用引用的 url 获取该 div 中的数据。
<div class="video-embed-big video-embed-area bf_dom" id="video_buzz_element_4154403_7994283" rel:thumb="https://img.youtube.com/vi/_Ym0LW_uPPk/2.jpg" rel:bf_bucket_data="{"video": {"size": "big", "width":"625", "height":"376", "url":"https://youtube.com/watch?v=_Ym0LW_uPPk", "id":"4154403_7994283"}}">
<div style="position:relative;" id="video_wrapper_4154403_7994283">
<iframe id="yt_4154403_7994283" class="ytvideo" type="text/html" allowscriptaccess="always" allowfullscreen="true" width="625" height="376" src="https://www.youtube.com/embed/_Ym0LW_uPPk?version=3&hl=en&fs=1&enablejsapi=1&origin=http://www.buzzfeed.com&autoplay=0&showinfo=0&wmode=opaque" frameborder="0">
</iframe>
</div>
</div>
【问题讨论】:
标签: python web-scraping beautifulsoup