0
我需要POST cookies.txt然后使用CURL将页面下载到文本文件。这是我的FGC示例,但显然FGC对Cookie不好,所以我需要CURL。通过CURL使用Cookie下载文件使用PHP
<?php
$file = file('source\1.txt');
foreach ($file as $link)
{
$link = trim($link);
$link2 = "http://site-that.com/authenticates?={$link}";
$downloaded = file_get_contents($link2);
$myFile = "parsed/$link" . ".txt";
$fh = fopen($myFile, 'a') or die('Cannot open file');
fwrite($fh, $downloaded);
}
$timestamp = time();
rename('source\1.txt', "source/done/done-{$timestamp}.txt");
echo 'Finished';
任何想法?代码示例将不胜感激。一个简单的例子,这样做喜欢google.com会很好另外,如果你有另一种方式做到这一点,速度更快,请发表!
FGC对饼干并不坏。此外,您可能希望使用搜索而不是询问问题,但不清楚您在此处运行的问题。显示如何执行的代码包含file_get_contents或curl的Cookie均存在。 – hakre