解决方案 »

  1.   

    分两次/多次抓取
    其实对于ajax/验证码等等都是这样做的
      

  2.   

    header("Content-type:text/html;charset=utf-8");
    function request_by_curl($remote_server, $post_string)
    {
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $remote_server);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_NOBODY, false);
    curl_setopt($ch, CURLOPT_HEADER,true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array());
    $data = curl_exec($ch);
    curl_close($ch);
    return $data;
    }
    //获取验证码
    file_get_contents("http://jysx.scnu.edu.cn/VerifyImg.aspx");
    $cookie = $http_response_header[6];
    $code = substr($cookie,23,4);
    echo $code."<br>";

    //post登录
    $remote_server = "http://jysx.scnu.edu.cn/login.aspx";
    $post_string = 'act=login&type=ajax&name=20102301025&pass=523523&verify='.$code;
    echo request_by_curl($remote_server,$post_string);这是我模拟登录华南师范大学抢实习的php代码,好像不行啊