I use simple_html_dom to parser html,follow is my core code
set_time_limit(10000);
foreach ($urlList as $url) {
ini_set('default_socket_timeout', 5);
$context = stream_context_create(
array(
'http'=>array(
'method' => 'GET',
'timeout' => 5
),
)
);
$shd->load_file($url, false, $context);
var_dump(0);
$html = $shd->find("table");
...
}
But it doesn't work for load_file()
timeout, only stop script when over 10000 seconds set_time_limit(10000)
;
I hope load_file
skip to the next task when the current task over 5 seconds,is there a way to get it?