Answer the question
In order to leave comments, you need to log in
How to retrieve page content?
It is necessary to take the content of the page, but there are blocks on the page in which the data is written through js, that is, you need to get the content after all the js has been completed.
For example
, we have a block in which a certain rating is indicated, but this rating appears after the page is loaded (data is substituted through js)
How can I get the correct data?
Answer the question
In order to leave comments, you need to log in
Purely in PHP - no way. You need a full browser for this. Look in the direction of phantomjs, with its help you can programmatically load the page, set a timeout of half a second (or how long it takes for js to work), and since you have full access to the DOM, you can immediately pick out all the data there and transfer it to where farther.
The fastest crutch - use setTimeout().
Pseudocode:
setTimeout(function() {
getRating();
}, 5000);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question