JavaScript コードの値を取得する必要があります。より正確には document.location.href ですが、PHP でこれを行う必要があります。
実際に私はこれをやっています:
$html = file_get_html("http://server.camgate.ru/snapshot.php?camid=111013191059");
$element = $html->find('img');
$img = $element->src;
そしてそれはprogress.gifを示しています。それはクールです。問題は、そのWebページ内のjavascriptのhrefを取得して、画像を表示する必要があることです。
このような:
$url = "http://server.camgate.ru/snapshot.php?camid=111013191059";
$html = file_get_html($url);
$element = $html->find('script');
$link = $element->href;
$data[] = array("camara" =>"Camara 1", "imagen"=>$link);
$html はこれを示しています:
<script> \n width=document.body.clientWidth; \ndocument.location.href = \"http:\/\/camgate.ru\/showpix.php?id=111013191059&m=1013&d=171013&pix=171013035306.jpg\"; \n<\/script>
だから私はそこに投稿されたURLを取得する必要があります。しかし、$element->href を使用すると、null が表示されます。
どうすれば入手できますか?
前もって感謝します