从包含SESSION ID的url中获取内容

时间:2014-01-02 15:41:46

标签: php parsing session pdf session-variables

我正在尝试从网站(合法地)获取项目所需的一些PDF文件,但遇到了一些问题。

PDF文件的位置网址为f.e. example.com/?download_id=290758&s=d12134cac7ddb2198d232bba75c07d57&t=2-1-2014%2016:19:00

首先,我使用以下代码从包含它的页面解析此URL:

$html = file_get_html('http://www.example.com/Acer-CR-6530/manual-5-100076.html');

// find the download link containing the session ID    
foreach($html->find('a[rel=nofollow]') as $e) 
    $link = $e->href;
$link = $baseURL . $link; 
// Link: example.com/?download_id=290758&s=d12134cac7ddb2198d232bba75c07d57&t=2-1-2014%2016:19:00
echo file_get_contents($link);

这不起作用。它不输出PDF文件。我应该使用cURL吗?如果是这样,我不是cURL专业人士,所以我很乐意看到这样做的代码。

提前致谢!

0 个答案:

没有答案