0
$data = array();

$html = file_get_html('www.example.com');


foreach($html->find(".bidsTable tr") as $tr){
    $row = array();
    foreach($tr->find("td") as $td){
        /* enter code here */
       $row[] = $td->plaintext;
    }
    $data[] = $row;
}

I am using this code to get the content from external url but I do not get the full html code is there any way to get the content when that page is fully loaded. any help will be appreciated.

Pardeep Kumar
  • 83
  • 1
  • 9

1 Answers1

0

You can use cURL to get HTML content,

try like this, It will certainly wait until content is loaded.

$ch = curl_init("http://www.example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
$html = curl_exec($ch);
curl_close($ch);

foreach($html->find(".bidsTable tr") as $tr){
$row = array();
foreach($tr->find("td") as $td){
  /* enter code here */
  $row[] = $td->plaintext;
}
$data[] = $row;
}
Nikunj Sardhara
  • 638
  • 1
  • 5
  • 20