as shown in the figure below, I can catch data when simulating POST. In the past, the idea I used to write was to simulate login, then save Cookie, and then curl to log in with the saved Cookie to obtain data directly, but now the interface has changed. I need to post json first and then get it. Baidu can"t do a lot of things. Ask for help.
Code for simulating login:
function login_post($url, $cookie, $post){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$header = array ();
$header [] = "Host:id.kuaishou.com";
$header [] = "Connection:keep-alive";
$header [] = "Content-Type:application/x-www-form-urlencoded";
$header [] = "Cookie:did=web_xxxxx";
curl_setopt($ch, CURLOPT_HTTPHEADER, $header );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
$login = curl_exec($ch);
curl_close($ch);
return $login;
}
then if you want to use the $cookie you just saved to grab the data, you will not be able to catch
.you can succeed with the tool post, as shown in the following figure: