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