使用snoopy類比登入-登入失敗-多網域名稱跳轉

來源:互聯網
上載者:User
代碼如下:
agent = "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.122 Safari/537.36 SE 2.X MetaSr 1.0"; $snoopy->referer = "http://agent.fang.com/";$snoopy->rawheaders["Pragma"] = "no-cache";$snoopy->maxredirs = 2;//重新導向次數$snoopy->offsiteok = false;$snoopy->user = "esf-agen42249";$snoopy->pass = "dlesf2010";$submit_url = "http://agent.fang.com/DealLoginAjax.aspx";$submit_vars["str_username"] = "esf-agen42249";$submit_vars["str_userpwd"] = "dlesf2010";$submit_vars["str_imgCode"] = "請輸入驗證碼";$snoopy->submit($submit_url,$submit_vars);$snoopy->setcookies();if($snoopy->fetch("http://b.agent.fang.com/magent/HomePage.aspx")){print_r($snoopy->headers);print_r($snoopy->cookies);echo("");//print_r($snoopy->results);//無法擷取登入後才能看到的頁面}elseecho "error: ".$snoopy->error."\n";?>


請大神指點一下,好像是登入失敗,無法擷取登入後的主介面


回複討論(解決方案)

不會玩就看文檔。不會玩至少應該先看看http請求資料吧?

正常登陸,看HTTP資料轉送:

Remote Address:111.40.195.21:80Request URL:http://agent.fang.com/DealLoginAjax.aspx?str_username=esf-agen42249&str_userpwd=571c041891354cc5b51725f0b37170f80efb4f27ba8c897e4ff67ebe17b4ce599f28ac5f7eceeb5ff2d9755c62a57db74f206d3c52ccb79b71c24e3858f29ac7d49dfb8d77192529ac387b4e9c6426ecf70f3003ce348dcd6bd4d1af84e9293164516745c654d2c9bc0089c80f02ba5f69aeaac1e142c8af8e000ac7b1a4a278&str_imgCode=%E8%AF%B7%E8%BE%93%E5%85%A5%E9%AA%8C%E8%AF%81%E7%A0%81Request Method:GETStatus Code:200 OK



str_username=esf-agen42249&str_userpwd=571c041891354cc5b51725f0b37170f80efb4f27ba8c897e4ff67ebe17b4ce599f28ac5f7eceeb5ff2d9755c62a57db74f206d3c52ccb79b71c24e3858f29ac7d49dfb8d77192529ac387b4e9c6426ecf70f3003ce348dcd6bd4d1af84e9293164516745c654d2c9bc0089c80f02ba5f69aeaac1e142c8af8e000ac7b1a4a278&str_imgCode=%E8%AF%B7%E8%BE%93%E5%85%A5%E9%AA%8C%E8%AF%81%E7%A0%81



看清楚了嗎?GET登陸的?

不會玩就看文檔。不會玩至少應該先看看http請求資料吧?

正常登陸,看HTTP資料轉送:

Remote Address:111.40.195.21:80Request URL:http://agent.fang.com/DealLoginAjax.aspx?str_username=esf-agen42249&str_userpwd=571c041891354cc5b51725f0b37170f80efb4f27ba8c897e4ff67ebe17b4ce599f28ac5f7eceeb5ff2d9755c62a57db74f206d3c52ccb79b71c24e3858f29ac7d49dfb8d77192529ac387b4e9c6426ecf70f3003ce348dcd6bd4d1af84e9293164516745c654d2c9bc0089c80f02ba5f69aeaac1e142c8af8e000ac7b1a4a278&str_imgCode=%E8%AF%B7%E8%BE%93%E5%85%A5%E9%AA%8C%E8%AF%81%E7%A0%81Request Method:GETStatus Code:200 OK



str_username=esf-agen42249&str_userpwd=571c041891354cc5b51725f0b37170f80efb4f27ba8c897e4ff67ebe17b4ce599f28ac5f7eceeb5ff2d9755c62a57db74f206d3c52ccb79b71c24e3858f29ac7d49dfb8d77192529ac387b4e9c6426ecf70f3003ce348dcd6bd4d1af84e9293164516745c654d2c9bc0089c80f02ba5f69aeaac1e142c8af8e000ac7b1a4a278&str_imgCode=%E8%AF%B7%E8%BE%93%E5%85%A5%E9%AA%8C%E8%AF%81%E7%A0%81



看清楚了嗎?GET登陸的?



非常感謝╰(*´︶`*)╯怎麼擷取這個資訊:Request URL:http://agent.******

F12審查元素,network

F12審查元素,network



登入後直接跳轉了,怎麼暫停查看?

暈(=_=)結貼分數怎麼沒發出去?怎麼改?

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.