The current use is simple_html_dom, it obtains the way of the Web page directly file_get_contents obtains the webpage, but for the JS Generation page cannot obtain, what method can use PHP to crawl the JS dynamically generated page?
Reply content:
The current use is simple_html_dom, it obtains the way of the Web page directly file_get_contents obtains the webpage, but for the JS Generation page cannot obtain, what method can use PHP to crawl the JS dynamically generated page?
This is not a good implementation, or now JS of the MVVM framework will not have to think about the server rendering to do SEO ...
Can be used V8JS ,phantomjs
If the Ajax generation gets the corresponding URL return value, you can
or analyze the request, find the interface simple point.
It is relatively easier to use PHANTOMJS+NODEJS to handle such problems.
PHANTOMJS is an interface-free browser environment that can load URLs and render pages. To simulate the user's browser input URL to open the page after the effect of rendering. The interface provided by PHANTOMJS is then programmed to fetch the rendered content.
http://phantomjs.org/
1, Phantomjs
2, if JS is the asynchronous loading of data, direct PHP read that interface data.