I cannot get webpage content using php, but I can access webpage content using a browser. what is the situation? Solution

Source: Internet
Author: User
I cannot get webpage content using php, but I can access webpage content using a browser. what is the situation? According to the facts, we can infer what the problem is. 1. the server can normally access the target webpage using a browser. 2. the same website cannot be obtained using php. Test Code: & lt ;? Php $ a & nbsp; = & nbsp; file_get_contents (php cannot get the webpage content, but the browser can access the webpage content. what is the situation?
What is the problem based on facts?
1. the server can access the target webpage through a browser.
2. php cannot obtain the webpage content for the same website.

Test code:

$ A = file_get_contents ('Destination website ');
Var_dump ($ );
?>


The result is as follows:



Clearer Picture:/img/2014/02/21/112105778 .jpg

In any case, you can always get a piece of js. This section of js seems to be responsible for turning.



In addition, this code seems to be dynamic. every time the function name variable name changes dynamically, it should be automatically generated by some software.


3. for the same program code, other servers can normally obtain the webpage content of the target website.

Based on the above facts, we can infer what went wrong?

What are the server-specific restrictions on the target website? Or server configuration problems? Please answer!
------ Solution --------------------
Js code returns results only after it is run.
You only obtained the js code but didn't run it. how can you get the result?

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.