, how does PHP get the content of the Web page? Not the same as normal.
Source: Internet
Author: User
Ask everyone, how does PHP get Web content? It's not the same as normal.!!!!!
is to obtain the content of the Web page, I mainly want to get a div inside the data, but the data here is he over a period of time and then through the JS to change the data inside the div ...
I use file_get_contents only to get to his first data ... After he changed the data by JS did not get to ....
Thank you, everyone.
------Solution--------------------
There is no way to get, PHP can not determine when the content of the page changed, and to crawl the data must be executed once a request, each request will only get the most original data
------Solution--------------------
Direct simulation of his AJAX access to data. Grab the packet and see what address curl is going to catch.
------Solution--------------------
Ajax can really:
Sets the trigger function to execute once every n seconds, which takes the data in the div and then passes it to the backend.
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