I need to get some content from external URL. I have setup a cURL and try to get data from
URL: http://statistik.innebandy.se/ft.aspx?scr=playercareer&fplid=182506
My code just now:
$url = “http://statistik.innebandy.se/ft.aspx?scr=playercareer&fplid=182506”;
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$html = curl_exec($ch);
$data = file_get_contents($url);
$dom = new domDocument;
@$dom->loadHTML($data);
$dom->preserveWhiteSpace = false;
$tables = $dom->getElementsByTagName(‘table’);
$rows = $tables->item(2)->getElementsByTagName(‘tr’);
print_r($rows[0]);
foreach ($rows as $row) {
$cols = $row->getElementsByTagName(‘td’);
}
How can i get every row from the table?