Home  >  Q&A  >  body text

When file_get_contents obtains the Kugou webpage, the src of the <audio> tag is empty.

 $urlBefore = "https://www.kugou.com/song/#";
foreach ($urlData as $key => $value) {
$url = $urlBefore . "hash=" . $value["hash"] ."&album_id=".$value['album_id'];
echo $url."<br/>";
$htmlFile =phpQuery::newDocumentFileHTML($ url);
$title = pq("#myAudio");
$url0 = pq($title[0])->attr("src");
print($url0." <br/>");

}

//$url0 variable is empty, the website source code can be obtained, but the value of the src attribute of the <audio> tag is unknown, is this blocked? How do I get it?

一杯水一杯水1980 days ago979

reply all(0)I'll reply

No reply
  • Cancelreply