我成功地设置了一个简单的php抓取,它可以从页面中抓取标题和图像
$post=$_POST['post'];
$html = file_get_html($post);
$title = $html->find('h2', 1);
$imageurl = $html->find('img', 1);
echo $title->plaintext."<br>'n";
echo $imageurl->src;
但我也试图获取视频嵌入代码,它使用像这样的iframe
<input type="text" name="media_embed_code" id="mediaEmbedCodeInput" size="110" onclick="this.focus();this.select();" value="<iframe src="http://drunksportsfans.com/embedframe/537" frameborder=0 width=510 height=400 scrolling=no></iframe>">
我只需要价值部分,但它显然比标题和图像更复杂
这很简单:
$value_of_input = $html->find('input[name=
media_embed_code]',0)->值;