采集时发现我模拟登录时取的id值是变化的,登录成功是有一个ID值
  如果用这个ID值去采集时,就不行,但是1先打下网页登录一下,
2在点可弹出窗口,
3在弹出窗口运行采集页,先要手工把ID值填写好
采集成功有什么好办法解决?

解决方案 »

  1.   

    COOKIES 没有正确的写到浏览器的HEADER中。
      

  2.   

    加什么参数,请教高人<?php 
    $cookie_jar = 'cookie.txt';
    $data = array('mvfAdminMonths'   => '200706', 
                  'mvfSiteProvinces' => 'Beijing', 
                  'whichFirst'     => 'AS',
                  '__act'        => '__id.22.SeatsQuery.adp.actList', 
      'submit.x'=> '28',
      'submit.y'=> '9'); 
    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL,'http://toefl.etest.edu.cn/cn/SeatsQuery'); 
    curl_setopt($ch, CURLOPT_POSTFIELDS,$data); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,false); 
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_jar);
    echo curl_exec($ch);
    sleep(30);
    $data = array('mvfAdminMonths'   => '200706', 
                  'mvfSiteProvinces' => 'Beijing', 
                  'whichFirst'     => 'AS',
                  '__act'        => '__id.22.SeatsQuery.adp.actList', 
      'submit.x'=> '28',
      'submit.y'=> '9'); 
    $ch2 = curl_init(); 
    curl_setopt($ch2, CURLOPT_URL,'http://toefl.etest.edu.cn/cn/SeatsQuery'); 
    curl_setopt($ch2, CURLOPT_POSTFIELDS,$data); 
    curl_setopt($ch2, CURLOPT_RETURNTRANSFER,false); 
    curl_setopt($ch2, CURLOPT_COOKIEFILE, $cookie_jar); 
    echo curl_exec($ch2);
    curl_close($ch); 
    ?>