cURL returns 404 while the page is found in browser

前端 未结 4 787
误落风尘
误落风尘 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:51

    I quickly checked the said page with LiveHeaders enabled and I noticed bunch of cookies set. I suspect that, since it's not "normal" url, you need to hand those cookies while being redirected otherwise you end being kicked out with 404. Use CURLOPT_COOKIEJAR with your cURL instance at start. See: http://php.net/manual/pl/function.curl-setopt.php

提交回复
热议问题