You can't get web content with PHP, but you can access Web content in a browser, what's the situation?

Source: Internet
Author: User
This post was last edited by u013067065 on 2014-01-03 13:46:46

Let's just infer from the facts what the problem is.
1. The server can use the browser to access the target Web page normally
2, the same URL with PHP can not access the content of the page.

Test code:
 
  


The results are as follows:



Clearer Picture: http://img.bbs.csdn.net/upload/201401/03/1388727791_847070.jpg

No matter what, always get a section of JS. This section of JS seems to be responsible for steering.



And this code seems to be dynamic, each time the function name variable name will change itself dynamically, it should be some kind of software generated automatically.


3, the same program code, other servers can normally get to the destination URL of the page content.

According to the above facts, then you can infer where the problem is?

What are the restrictions on the target site for the server? Or is it a server configuration issue? Ask for answers!


Reply to discussion (solution)

JS code is to run after the results will be
You only get the JS code, but not run, how can I get results?

JS code is to run after the results will be
You only get the JS code, but not run, how can I get results?

That's where the problem lies.

Maybe the third fact I did not describe clearly, the third Test gets the page content is normal Web content. Not JS.

JS code is to run after the results will be
You only get the JS code, but not run, how can I get results?

Can be sure that the other side to open the anti-collection mechanism. Because you can get it at first, you can't get it with constant reading.

No one will be willing to play with your riddles.

No one would want to play a guessing game with you. The information I provide is clear, you can not be able to answer while playing.

I've had the same problem.

  • Related Article

    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.