Emergency Snoopy grab EMS verification Code, remote simulation query number, unable to obtain jsessionid of the relevant issues

Source: Internet
Author: User
Urgent: Use Snoopy grab EMS verification Code, remote analog query number, unable to get jsessionid problem?
Member life169 before in the PHP section of an article called ( use Snoopy crawl EMS verification Code, remote simulation query number, get query results)
Link is: http://topic.csdn.net/u/20100715/23/d58f2006-40ea-4cab-82e3-3bbcf4cd1e9f.html


But I encountered a problem in the process of testing, jsessionid, often will not be taken,

Session_Start ();
Include ("Snoopy.class.php");
$url = "Http://www.ems.com.cn/qcgzOutQueryNewAction.do?reqCode=gotoSearch";
$url 2 = "http://www.ems.com.cn/qcgzOutQueryNewAction.do";

$snoopy = new Snoopy;
$snoopy->fetch ($url); Get all content
Print_r ($snoopy->headers);

The print header information, which is returned:
Array ([0] = http/1.1-OK [1] = content-type:text/html; charset=gb2312 [2] = = x-powered-by:servlet/2.4 JS p/2.0 [3] = accept-ranges:bytes [4] = connection:close [5] = Date:tue, [Mar] 11:24:53 GMT [6] = A ge:1876 [7] = content-length:22804)

The correct return information should be:
Array ([0] = http/1.1-OK [1] = cache-control:no-cache= "Set-cookie" [2] = connection:close [3] = Dat E:fri, Mar 07:42:04 GMT [4] = content-type:text/html; charset=gb2312 [5] = set-cookie:jsessionid=n5sms1dmw1wy8lj48z1zhp1p2ks1gsgy5twtnxcypz1mvgyzk0lq!195316506; path=/[6] = x-powered-by:servlet/2.4 jsp/2.0)

The back of the inside no jsessionid, resulting in the query in the back of the query results can not be returned, I have been the whole 2 days, in the Internet to check a large amount of information, or no clue, there is now a strange phenomenon, If the browser opens the Ems.php page, after a period of time and then refresh the page, will return the correct headers information, but after a while can not be returned correctly, why this situation, I hope that there are prawns can help me see what is going on? Tokyu



------Solution--------------------
Yes, well, let's get down here.

http://download.csdn.net/source/3100240
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.