我一直在嘗試使用curl登錄barnesandnoble.com移動(dòng)網(wǎng)站,到目前為止還沒有運(yùn)氣。我返回的頁面沒有任何錯(cuò)誤,它再次將我的電子郵件默認(rèn)設(shè)置為登錄頁面的電子郵件輸入表單框(使用print $ result返回的表單)。通過更改LOGINURL指向eBay的登錄名,相同的代碼實(shí)際上可以使我正確地進(jìn)入ebay。唯一的區(qū)別是barnesandnobles是https://,而ebay登錄是http://另外,我相信barnes網(wǎng)站是asp / aspx,所以我不知道該如何處理cookie和_state在過去16小時(shí)內(nèi)嘗試調(diào)試時(shí),我們將提供任何幫助另外,我的cookie.txt是可寫的并且可以正常工作<?php $cookie_file_path = "C:/test/cookie.txt"; $LOGINURL = "https://cart2.barnesandnoble.com/mobileacct/op.asp?stage=signIn"; $agent = "Nokia-Communicator-WWW-Browser/2.0 (Geos 3.0 Nokia-9000i)"; $ch = curl_init(); $headers[] = "Accept: */*"; $headers[] = "Connection: Keep-Alive"; $headers[] = "Content-type: application/x-www-form-urlencoded;charset=UTF-8"; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_URL, $LOGINURL); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); $content = curl_exec($ch); curl_close($ch); unset($ch); // NAME="path_state" value="6657403"> if(stristr($content,"path_state")){ $array1 = explode('path_state" value="',$content); $content1 = $array1[1]; $array2 = explode('">',$content1); $content2 = $array2[0]; } $LOGINURL = "https://cart2.barnesandnoble.com/mobileacct/op.asp?stage=signIn"; $POSTFIELDS = "d_hidPageStamp=V_3_17&hidViewMode=opSignIn&stage=signIn&previousStage=mainStage&path_state=" . $content2 . "&emailAddress=YOUREMAILHERE@gmail.com&acctPassword=YOURPASSWORD"; $reffer = "https://cart2.barnesandnoble.com/mobileacct/op.asp?stage=signIn";
- 1 回答
- 0 關(guān)注
- 438 瀏覽
添加回答
舉報(bào)
0/150
提交
取消