import requests url = 'https://c.y.qq.com/soso/fcgi-bin/client_search_cp' for x in range(5): headers = { 'origin':'https://y.qq.com', 'referer':'https://y.qq.com/portal/search.html#page=1&searchid=1&remoteplace=txt.yqq.top&t=lyric&w=%E5%91%A8%E6%9D%B0%E4%BC%A6', 'user-agent':'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36', } parmas = { 'ct':'24', 'qqmusic_ver':'1298', 'remoteplace':'txt.yqq.lyric', 'searchid':'95856484634231303', 'aggr':'0', 'catZhida':'1', 'lossless':'0', 'sem':'1', 't':'7', 'p':str(x+1), 'n':'5', 'w':'周杰伦', 'g_tk':'5381', 'loginUin':'0', 'hostUin':'0', 'format':'json', 'inCharset':'utf8', 'outCharset':'utf-8', 'notice':'0', 'platform':'yqq.json', 'needNewCode':'0', } res_lyric = requests.get(url,headers=headers,params=parmas) json_lyric = res_lyric.json() list_lyric = json_lyric['data']['lyric']['list'] for lyric in list_lyric: print(lyric['content'])
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:Python爬虫_qq音乐示例代码 - Python技术站