I would like to get 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 that Wikipedia does not send the tag <script>to the PHP request, so it does not show JavaScript. I assume that since Wikipedia sees that the "requestor" does not have JavaScript, so it does not send tags <script>.
How can I tell Wikipedia that my PHP has JavaScript enabled?
I heard about the context of the stream, but I don't know how to set JavaScript for it.
source
share