I know I can use something like file_get_contents to save a web page's source locally, and I know how to manipulate the text of it. But what if the web page has JavaScript that dynamically generates content? How can I download the fully rendered page source?
Asked
Active
Viewed 363 times
2
Two-Bit Alchemist
- 16,887
- 5
- 44
- 79
user3122218
- 29
- 4
-
PhantomJS is a good choice, and is easy to integrate. – Brad Mar 11 '14 at 18:07
1 Answers
0
You need to pass the data through a rendering engine. The simplest option is to programmatically control a web browser. Libraries that will help you do that include Selenium and php-phantomjs.