simple_html_dom.php下载就可以,百度一下你就知道

require_once "simple_html_dom.php";   
    function find($value)  
    {  
        $qurl='http://music.baidu.com/search?key='.$value; 
        $html1=file_get_html($qurl);  
        $div=$html1->find('span[class=song-title]',0);  
        $link1=$div->first_child ()->href; 
        $link2='http://music.baidu.com/'.$link1.'/download'; 
        $html2=file_get_html($link2);
        $download=$html2->getElementById('download');  
        $url=$download->href;
        $title=$html2->find('span[class=fwb]',0)->plaintext;
        $author=$html2->find('span[class=author_list]',0)->plaintext;  
        return array('title'=>$title,'author'=>$author,'url'=>substr($url,22));  
    } 
     $result = find("一首心歌");
    //echo $result['title']."<br/>";  
    //echo $result['author']."<br/>";  
    //echo $result['url']; 
这样大家可以自己试试,获取一下下载地址!

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论

微信小程序

微信扫一扫体验

立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部