0
怎麼會看的代碼與請求蟒蛇,如果捲曲的代碼,如:捲曲代碼到Python轉換
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_COOKIESESSION, 1);
curl_setopt($ch, CURLOPT_COOKIE, 'id='.$id);
$result = curl_exec($ch);
因爲這一個不爲我工作
id="j4156f9150ece727e38bbf982634ee"
cookie = {'id': id}
content = requests.post(url, cookies=cookie)
print(id)
print(cookie)
print(content.url)
print(content.cookies)
結果是:
['j4156f9150ece727e38bbf982634ee']
{'id': 'j4156f9150ece727e38bbf982634ee'}
http://example.com
<<class 'requests.cookies.RequestsCookieJar'>[]>
這是什麼意思?