It's simple question, but I couldn't get the h1
tag's text. DOMparser returns this error.
$results = 'http://www.daikyo.co.jp/KOBETSU/MF081014/gaiyo_chg.html?_ga=2.231780890.465420601.1540169716-1978642370.1538226055&_bdld=HYzpv.moBqKE6';
$html = file_get_contents($results);
$DOMParser = new \DOMDocument();
$DOMParser->loadHTML($html);
$changeForMyDB = [
'region' => '関西',
'link' => json_encode($results),
'building_name' => '',
'price' => '',
'old_price' => '',
'extend' => '',
'address' => '',
'total_house' => '',
'rooms' => '',
'cons_finish' => '',
'entry' => '',
'balcony' => '',
'company_name' => '',
'list_from' => 'daikyo'
];
$changeForMyDB['building_name'] = trim($DOMParser->getElementsByTagName('h1')->nodeValue);
The text inside h1 not returning?