【发布时间】:2019-12-22 20:15:27
【问题描述】:
我是使用 PHP 解析 HTML DOM 的新手,有一个页面包含不同的内容但具有相同的“类”,当我尝试获取内容时,我能够获取最后一个 div 的内容,是吗可能我能以某种方式获得具有相同课程的所有 div 内容,请您查看我的代码:
<?php
include(__DIR__."/simple_html_dom.php");
$html = file_get_html('http://campaignstudio.in/');
echo $x = $html->find('h2[class="section-heading"]',1)->outertext;
?>
【问题讨论】:
标签: php dom simple-html-dom