通过xpath获取iframe src

时间:2015-01-21 23:28:25

标签: xml iframe xpath web-scraping

我正在尝试从here中提取iframe src<div class="video-wrapper"> <iframe src="http://www.youtube.com/embed/6KAG7kltnuE? autohide=1&amp;color=white&amp;fs=1&amp;autoplay=0&amp;iv_load_policy=3&amp;rel=0&amp;modestbranding=1&amp;showinfo=0&amp;hd=1" frameborder="0" width="940" height="526" allowfullscreen></iframe> </div>

我当前的XPath已关闭且为//div[@class="video-wrapper"]/iframe/[@src]

1 个答案:

答案 0 :(得分:1)

试试这个XPath:

//div[@class="video-wrapper"]/iframe/@src