链接= https://www.joemyerstoyota.com/new-inventory/index.htm
我的代码:
$websiteUrl = 'https://www.joemyerstoyota.com/new-inventory/index.htm';
$curl = curl_init();
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($curl, CURLOPT_URL, $websiteUrl);
curl_setopt($curl, CURLOPT_REFERER, $websiteUrl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$str = curl_exec($curl);
curl_close($curl);
$html_base = new simple_html_dom();
$html_base->load($str, TRUE, FALSE);
$mydata = array();
foreach($html_base->find('div.hproduct auto toyota') as $key => $element)
{
$mydata = $element->attr;
}
print_r($mydata);
显示空白输出。有人可以帮忙吗?