Is it possible to get data from ajax request?

When I need to get content from the site, I use the function file_get_content(), but now I need to capture the data that is downloaded after the request ajax. therefore, I cannot provide the exact URL. are there any algorithms to do such things?

Thank.

+3
source share
4 answers

If I understand your question correctly, you want to make a Get_content file on a website that loads AJAX data ... this is a client-side process that occurs when a client browser hits it, seeing that you are making a server request you will not see.

, ajax, NET firebug, , .

+3

, JavaScript, Rhino, , .

0

Net firebug (firefox) Chromes Developer Tools, AJAX . javascript, php script - . PHP--, file_get_contents cURL ( POST). , , - , script.

URL , , , URL- , .

0

, . jQuery load() :

$('#my_container').load('local_proxy.php #container');

- file_get_contents() , id "container" (.. <div id="container">) "my_container" ".

, , , js...: P

0

Source: https://habr.com/ru/post/1749248/


All Articles