When javascript-PHP crawls a webpage, it encounters a regular JS jump.

Source: Internet
Author: User
The captured webpage content is {code ...} the status code obtained by crawling the program is 200. using fiddler to capture the URL of the browser, it is found that the status code is 302header with Location :( e24a2c455vo1xe45nl%me55) default2.aspx is not because the curl crawls the JS page because... the captured webpage content is


  
  
  
  《script》function JumpSelf(){       self.location="/?WebShieldSessionVerify=PIHIFboME3yzpTl2p9T2";}《script》《script》setTimeout("JumpSelf()",700);《script》

The status code obtained by crawling the program is 200.
Using fiddler to capture the browser link and find that the status code is 302
The header contains Location:/(e24a2c455vo1xe45nl1_me55)/default2.aspx.

Is it because curl crawls to the JS page because it is scheduled to jump to 700 milliseconds, so curl thought it would stop without a jump? How can this be solved? Do I use regular expressions for matching?

Reply content:

The captured webpage content is


  
  
  
  《script》function JumpSelf(){       self.location="/?WebShieldSessionVerify=PIHIFboME3yzpTl2p9T2";}《script》《script》setTimeout("JumpSelf()",700);《script》

The status code obtained by crawling the program is 200.
Using fiddler to capture the browser link and find that the status code is 302
The header contains Location:/(e24a2c455vo1xe45nl1_me55)/default2.aspx.

Is it because curl crawls to the JS page because it is scheduled to jump to 700 milliseconds, so curl thought it would stop without a jump? How can this be solved? Do I use regular expressions for matching?

In two steps, the first step is to capture your page and extract the link in js. Step 2: capture the corresponding page of the link in js.
You may need to synchronize cookies on multiple pages. For more information, see curl cookieJar cookieFile in the manual.

Because the crawler is not a browser and does not execute the code in the script

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.