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
  • 17,966
  • 6
  • 47
  • 82

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
  • 914,110
  • 126
  • 1,211
  • 1,335