2013-05-13 3 views
-1
<div class="divHeaderContainer1"> 
<table width="488" cellspacing="0" cellpadding="0" height="63"> 
<tbody> 
<tr> 
<td height="61"> 
<a href="jobs/jobdetails.php?recordID=5300"> Job Vacancy For Media and Production  Officer At The International Committee of the Red Cross (ICRC)&nbsp; </a> 
<div class="jobDate">posted on 2013-05-10&nbsp;&nbsp;|&nbsp;by Admin |&nbsp;0 comments&nbsp;|&nbsp; 379 views </div> 
</td> 
</tr> 
</tbody> 
</table> 
</div> 

아래의 코드로 웹 사이트 (www.employmentng.com)에서 href 속성을 검색하려고했으나 아무 것도 반환하지 않았습니다.단순한 html dom과 함께 내용을 검색하지 않습니다.

$url='http://www.employmentng.com/index.php?pageNum_Jobs=1&totalRows_Jobs=5127'; 
$html = file_get_html($url); 

foreach($html->find('div[class=divHeaderContainer1]') as $container){ 
    foreach($html->find('table td[height]') as $table){ 
     foreach($table->find('a') as $link{ 
      echo $link-href; 
     } 

    } 
} 

나는 당신이 구문 오류가이하시기 바랍니다

+1

가능성은 당신은'$ container-> find ("table ...")' 대신에'$ html-> find ("table ...")'? – Passerby

+0

나는 $ container-> find ('table ...)를 의미했다. –

답변

0

에 도움이 필요합니다. 그리고 아마 오류보고는

변경 라인

foreach($table->find('a') as $link{ 

줄을 너무 꺼져

foreach($table->find('a') as $link) { 

편집 : 거기

하나 이상의 오류 :

echo $link-href; 
echo $link->href; 
관련 문제