How to get in php the whole html of a page loaded partially from jquery

I have this problem for several days ... I need to download the entire html page from php. There is a jquery function on this page that is called when the whole page loads. This function loads another html into the page, so I need to load all the loaded html (the part loaded by jquery). I can know that I get the whole page trying to find a tag loaded only from jquery. (for example: entering a tag with the name XXX, entering a tag with a multiple attribute, etc.)

so i try:

$html = file_get_contents("http://wwww.siteToScrape.com");
if (strpos($html, 'multiple') !== false) {
    echo 'found';
} else {
    echo 'not found';
}

but the result is "not found".

Then I downloaded a simple html dom and try:

include 'simple_html_dom.php';
$html = file_get_html("http://wwww.siteToScrape.com");
if (strpos($html, 'multiple') !== false) {
    echo 'found';
} else {
    echo 'not found';
}

but the result is still "not found."

, php script, ( jquery ), PHP able Web Browser :

require_once('browser.php');
$browser = new SimpleBrowser();
$p = $browser->get('http://wwww.siteToScrape.com');
if (strpos($p, 'multiple') !== false) {
    echo 'found';
} else {
    echo 'not found';
}

. , .. - ??? !!!!

+2
3

, .

PHP Javascript ( jQuery) .

javascript PHP. , . , Java, , .

.

, - , javascript. , . .

+2

, " PHP". Javascript , , - .

:. javascript -, innerHTML - , ajax , ( - , , - ).

+2

, jquery javascript (-), .

PHP, , javascript.

, , javascript PHP, - -, . mink, back-end zombie node.js .

There is also a phantomjs browser without a browser with various PHP interfaces like this one , which I found with a quick google search.

In the more demanding arena, there is also selenium , which also has PHP interfaces.

+1
source

All Articles