cURL returns 404 while the page is found in browser

前端 未结 4 791
误落风尘
误落风尘 2020-12-06 19:13

there is already similar questions on stackoverflow, but none of their solutions have been working for me. I\'m trying to grab a page on LoveIt.com with cURL, but it return

4条回答
  •  生来不讨喜
    2020-12-06 19:57

    Thanks for your answer, so I did visit the page, saved the cookies in a cookies.txt file (with chrome extenson cookie.txt export) that I use NOT CURLOPT_COOKIEJAR, but for option CURLOPT_COOKIEFILE.

    $cookiefile = './cookie.txt';
    
    curl_setopt($curl, CURLOPT_COOKIEFILE, $cookiefile);
    

    and now it works ! Thanks for your feedback, it was really useful.

提交回复
热议问题