String strs="http://ptlogin2.qq.com/login?ptlang=2052&u="+uin+"&p="+pass+"&verifycode="+ checkCode+ "&aid=46000101&u1=http%3A%2F%2Ft.qq.com&h=1&ptredirect=1&ptlang=2052&daid=6&from_ui=1&dumy=&low_login_enable=1&low_login_hour=720&regmaster=&fp=loginerroralert&action=6-27-1386060169686&mibao_css=&t=1&g=1&js_ver=10056&js_type=1&login_sig="+login_sig+"&pt_rsa=0";
get = new HttpGet(strs);
get.setHeader("Accept","application/javascript, */*;q=0.8");
get.setHeader("Accept-Language", "zh-CN");
get.setHeader("Accept-Encoding", "gzip,deflate");
get.setHeader("Connection", "keep-alive");
get.setHeader("Host", "ptlogin2.qq.com");
get.setHeader("Referer", "http://ui.ptlogin2.qq.com/cgi-bin/login?appid=46000101&style=13&lang=&low_login=1&hide_title_bar=1&hide_close_icon=1&self_regurl=http%3A//reg.t.qq.com/index.php&s_url=http%3A%2F%2Ft.qq.com&daid=6");
get.setHeader("User-Agent","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)");
response = client.execute(get);
// response = client.execute(proxy,get);
entity = EntityUtils.toString(response.getEntity());
System.out.println("测试结果:"+entity);

解决方案 »

  1.   

    我现在想退一步,就算出验证码,我手动输入实现登录。
    但是现在输完验证码就是
    ptuiCB('7','0','','0','很遗憾,网络连接出现异常,请您稍后再试。(3933212426)', '0');
    前辈可曾遇到过此问题?
      

  2.   

    我现在想退一步,就算出验证码,我手动输入实现登录。
    但是现在输完验证码就是
    ptuiCB('7','0','','0','很遗憾,网络连接出现异常,请您稍后再试。(3933212426)', '0');
    前辈可曾遇到过此问题?
    我没做腾讯微博的,但是做过类似的东西。程序请求会被咔嚓掉,可以换换其他思路,比如用代理换IP等等