0

I want to get specific div content of another website.For this, I would simply do as below as described in this answer:

$url = 'https://somedomain.com/somesite/';
$content = file_get_contents($url);
$first_step = explode( '<div id="thediv">' , $content );
$second_step = explode("</div>" , $first_step[1] );

echo $second_step[0];

But the problem is that the content I want to get from is loaded through javascript. When I view the source of the website, it only shows some gibberish javascript with html. Due to this, the above code cannot get desired content.

How can I get required div content in such case?

Update: Please see the source code of the external website https://pastebin.com/7i5q9MbG

VijayRana
  • 953
  • 1
  • 13
  • 38
  • what does "*gibberish javascript with html*" mean? – James Aug 19 '18 at 10:25
  • Possible duplicate of [How to request div content from another site](https://stackoverflow.com/questions/15842109/how-to-request-div-content-from-another-site) – James Aug 19 '18 at 10:27
  • that link doesn't answer my question. we have separate different concerns here. I am talking about getting data from another websites loaded by javascript. – VijayRana Aug 19 '18 at 10:35

0 Answers0