使用CURL PHP在JavaScript执行后获取HTML代码 [英] Get HTML code after javascript execution using CURL PHP

查看:138
本文介绍了使用CURL PHP在JavaScript执行后获取HTML代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过使用 Curl(PHP) $ b $获得JavaScript生成的网页的html源代码我尝试了curl,但是我只得到了一个javscript代码: (

I want to get the html source of a webpage genereted by javascript using Curl(PHP) I tried the curl but I get just a javscript code :(

我可以使用ruby来解决我的问题吗?!

Can I use ruby to resolve my problem ?!

推荐答案

JavaScript由浏览器执行以生成HTML,如果您使用CURL提出请求,它会向您显示实际的HTML内容。您将需要一个Javascript引擎在收到响应主体后处理Javascript。

The javascript is executed by the browser to generate the HTML. If you make a request with CURL it will just show you the actual HTML content.You would need a Javascript engine to process the Javascript after receiving the response body.

这篇关于使用CURL PHP在JavaScript执行后获取HTML代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆