I am trying to find specific element from the pages below:
$links=array(
"https://www.computers.com/l_bg/?m=7&i=587609",
"https://www.computers.com/l_bg/?m=7&i=587610",
"https://www.computers.com/l_bg/?m=7&i=587607",
"https://www.computers.com/l_bg/?m=7&i=587502"
);
foreach($links as $link){
$newhtml = new simple_html_dom();
$newhtml->load_file($link);
foreach($newhtml->find('table.fpt > td.name') as $price){
echo $price=$price->innertext;
}
}
but the $price is empty.. The strange thing is that if I change the code to this:
$newhtml = new simple_html_dom();
$newhtml->load_file('https://www.computers.com/l_bg/?m=7&i=587609');
foreach($newhtml->find('table.fpt > td.name') as $price){
echo $price=$price->innertext;
}
the code works.. Why if I manual put the url it works, but when is in loop it doesn't? Can you please tell me what is wrong and how to find it?
for ($i=0; $i < 4; $i++) { ... }to see if it's some kind of timing issue.