2

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?

Two-Bit Alchemist
  • 16,887
  • 5
  • 44
  • 79

1 Answers1

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.

Community
  • 1
  • 1
Quentin
  • 857,932
  • 118
  • 1,152
  • 1,264