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