I would like to get the HTML code from a page with PHP. So I do this:
$url = 'http://en.wikipedia.org/wiki/New_York_City';
$html = file_get_html($url);
The problem is, Wikipedia doesn't send the <script>
tag to the PHP request, so it doesn't show the JavaScript.
I guess that's because Wikipedia sees that the "requester" doesn't have JavaScript enabled, so it doesn't send the <script>
tags.
How can I let Wikipedia know that my PHP is JavaScript enabled?
I heard about stream context, but I don't know how to set JavaScript enabled for it.