【发布时间】:2019-02-17 03:47:25
【问题描述】:
我想从这个链接下载 csv 文件:
https://www.nasdaq.com/investing/etfs/etf-finder-results.aspx?download=Yes
但这两种代码也不起作用。
$url = 'https://www.nasdaq.com/investing/etfs/etf-finder-results.aspx?download=Yes';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$str = curl_exec($curl);
echo $str;
和
$table = file_get_contents('https://www.nasdaq.com/investing/etfs/etf-finder-results.aspx?download=Yes');
请告诉我为什么此代码在此链接中不起作用。 谢谢!
【问题讨论】:
-
定义“不工作”。它做什么?错误信息?超时?
标签: php