0
以下simple_html_dom问题是我的代码:与查找特定类
<?php
include('simple_html_dom.php');
$rowdate;
$html = new simple_html_dom();
$html->load_file('http://www.forexfactory.com/calendar.php');
foreach($html->find('.calendar_row') as $e)
{
$date=$e->find('span.date');
if ($date[0] != "")
{
$rowdate=$date[0];
}
$time=$e->find('.time');
$currency=$e->find('.currency');
$impact=$e->find('.impact');
$event=$e->find('.event');
echo $rowdate;echo ",";
echo $time[0];echo ",";
echo $currency[0];echo ",";
echo $impact[0];echo ",";
echo $event[0];
echo "<br>";
}
上面的代码工作正常,但是$的影响并不是在所有而如果你在浏览器中直接打开网址,看到显示源代码中,我们可以看到每个calendar_row中存在影响类
任何人都可以请我指导我做错了什么?
影响类存在,但这些单元格如下所示:'
嗨@GolezTrol,获得价值的最佳方式是什么?我只需要显示影响程度,高,中,低。 – 2014-11-02 14:37:57