html - Simple PHP Dom Parser Can't Access -
i trying access 1 of turkish ministry of health websites: i've parsed news rest, 1 can't reach. i've tried many other tricks when try this, gets stuck , won't return , website freezes in part , doesn't load rest of website after part.
$html = file_get_html('http://www.tkhk.gov.tr/tr,6/duyurular.html'); $i = 0; foreach($html->find('a.belge_alt_b') $element){ echo " <a href=\"http://www.tkhk.gov.tr".$element->href." \">". $element->plaintext ."</a> "; $i++ ; if($i > 3) break; }
i've used same method others, said, 1 seems problem. can caused servers or not?
for whom may experience that;
check allowed memory size , debug script, use code below @ top of script , try again.
echo 'display_errors = ' . ini_get('memory_limit') . "\n"; // show maximum allowed memory usage ini_set('error_reporting', e_all); // error reporting ini_set('display_errors', 1); // error reporting
if error
fatal error: allowed memory size of 8388608 bytes exhausted (tried allocate 41 bytes)
then change memory limit wish.
ini_set('memory_limit', '32m');
Comments
Post a Comment