dongyuxiao6295 2015-06-25 19:41
浏览 911
已采纳

php curl获取html和js渲染

php curl only get the source code of a html page without executing the js script. I need for my website to get the source code with all the javascript already executed. I use ajax and I can't add more js in the page because script stay when I load another page. I find spiderMonkey but it can't fix my problem.

Is there something in php which do that ?

Thank you

  • 写回答

1条回答 默认 最新

  • dowaw80220 2015-06-25 20:56
    关注

    No you can't. Not from PHP directly.

    If you have control over the server you could install phantomjs and have it execute the code since it basically provides you with a headless browser that can do what you want.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?