PHP-获取外部网站的div内容,该内容由javascript动态加载

PHP-获取外部网站的div内容,该内容由javascript动态加载,php,html,web-scraping,domdocument,document,Php,Html,Web Scraping,Domdocument,Document,我想获得另一个网站的特定div内容。为此,我只需按照中的说明执行以下操作: $url='1!'https://somedomain.com/somesite/'; $content=file\u get\u contents($url); $first_step=分解(“”,$content); $second_step=explode(“,$first_step[1]); echo$second_步骤[0]; 但问题是我想从中获取的内容是通过javascript加载的。当我查看网站的源代码时

我想获得另一个网站的特定div内容。为此,我只需按照中的说明执行以下操作:

$url='1!'https://somedomain.com/somesite/';
$content=file\u get\u contents($url);
$first_step=分解(“”,$content);
$second_step=explode(“,$first_step[1]);
echo$second_步骤[0];
但问题是我想从中获取的内容是通过javascript加载的。当我查看网站的源代码时,它只显示一些带有html的乱七八糟的javascript。因此,上述代码无法获得所需的内容

在这种情况下,如何获取所需的div内容


更新:请查看外部网站的源代码

什么是“乱七八糟的javascript与html”意思?该链接的可能副本无法回答我的问题。我们在这里有不同的关注点。我说的是从另一个用javascript加载的网站获取数据。
$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];