如何使用Ajax的网站的file_get_contents [英] How to use file_get_contents on Ajax site

查看:284
本文介绍了如何使用Ajax的网站的file_get_contents的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 file_gets_contents($网站) <强>卷曲 加载网站,它加载整个网站?我主要是关于使用感兴趣的卷曲

我用它来加载一个网页,然后使用AJAX得到了一些内容,如价格,它有一些问题,得到的价格。

I am using it to load a webpage that then gets some contents such as price using AJAX and it has some problems getting the prices.

当我使用的file_get_contents,它为常作为一个整体的网站做的浏览器加上使用Ajax加载的东西装入?

When I use file_get_contents, does it load as normally as a whole website does on a browser plus the stuff loaded using Ajax?

推荐答案

没有。使用的file_get_contents()只会返回页面内容,也不会在页面本身上执行任何JavaScript。这种行为的模拟几乎等同于查看页面源代码在浏览器中。

No. Using file_get_contents() will only return the page contents, it will not execute any JavaScript on the page itself. The analog of this behaviour is almost equivalent to "View Page Source" in a browser.

这篇关于如何使用Ajax的网站的file_get_contents的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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