我正在尝试检索“<div class="grid_6 alpha liste_img_lien">
”新闻页面“http://www.lemonde.fr/
”的内容(图片和标题),以便在网页中显示。我看到很多使用简单html的例子,我试过但我无法达到目标,请有人帮我解决问题。
<section class="global bord_rubrique bordt3 international international deroule_edito" data-vr-zone="international">
<header>
<div class="container container_18">
<div class="grid_12 alpha">
<article class="img_tt_chapo" data-vr-contentbox="">
<div class="grid_6 alpha liste_img_lien">
<a data-vr-contentbox="" href="/international/visuel/2014/12/24/homs-la-ville-trophee-d-assad_4545940_3210.html">
<a data-vr-contentbox="" href="/international/article/2014/12/26/en-cote-d-ivoire-les-espoirs-decus-pour-une-justice-equitable_4546381_3210.html">
<a data-vr-contentbox="" href="/europe/article/2014/12/25/turquie-un-adolescent-de-16-ans-passible-de-4-ans-de-prison-pour-insulte-a-erdogan_4546085_3214.html">
</div>
<div class="grid_6 omega liste_img_lien">
</div>
<div class="grid_6 omega txt3_120 col_droite">
</div>
</div>
</div>
<p class="grid_18 lien_chaine">
</section>
这是我使用的代码
<?php
require 'simple_html_dom.php';
$html =new simple_html_dom();
$html->load_file("http://www.lemonde.fr/");
foreach($html->find('div[class="grid_6 alpha liste_img_lien]') as $element){
echo $element;
}
?>