python 爬取周杰伦歌曲信息

#爬取的信息不在网页源代码里所以用json解析
import requests
# 引用requests库
res_music = requests.get('https://c.y.qq.com/soso/fcgi-bin/client_search_cp?ct=24&qqmusic_ver=1298&new_json=1&remoteplace=txt.yqq.song&searchid=60997426243444153&t=0&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=1&n=20&w=%E5%91%A8%E6%9D%B0%E4%BC%A6&g_tk=5381&loginUin=0&hostUin=0&format=json&inCharset=utf8&outCharset=utf-8&notice=0&platform=yqq.json&needNewCode=0')
# 调用get方法,下载这个字典
json_music = res_music.json()
# 使用json()方法,将response对象,转为列表/字典
list_music = json_music['data']['song']['list']
# 一层一层地取字典,获取歌单列表
for music in list_music:
    # list_music是一个列表,music是它里面的元素
    print(music['name'])
    # 以name为键,查找歌曲名
    print('所属专辑:'+music['album']['name'])
    # 查找专辑名
    print('播放时长:'+str(music['interval'])+'秒')
    # 查找播放时长
    print('播放链接:https://y.qq.com/n/yqq/song/'+music['mid']+'.html\n\n')
    # 查找播放链接

我来吐槽

*

*

已有 43 条评论

  1. Breanna Stretch

    Hello,

    It is with sad regret to inform you that DataList.biz is shutting down. We have made all our databases available for you at a one-time fee.

    You can visit us on DataList.biz

    Regards.
    Breanna

  2. Franchesca Robbins

    It is with sad regret to inform you that BusinessLeads101.com is shutting down.

    We have over 300 million records available for a one time fee of $149.

    Please visit our website BusinessLeads101.com

    Regards,
    Franchesca

  3. Alanna Beor

    Hello.

    We are offering Bullet Proof SMTP servers that never get suspended. Email as much as you want.

    DMCA ignored, bulletproof locations, 100% uptime guaranteed, unlimited data transfer, and 24/7/365 support.

    100 Spots available. BulletProofSMTP.org

  4. Constance Barff

    Hello.

    It is with sad regret to inform you TopDataList.com is shutting down.

    We have made all our databases available for you for a once off fee.

    Visit us on TopDataList.com

  5. Torsten Bond

    Hello, from CustomData.click we are a provider of unique databases that could help your business.

    Please visit us at CustomData.click to see if we can help you.

    Regards,
    Torsten

  6. Josephine De Gillern
    Josephine De Gillern May 18th, 2022 at 01:20 am 回复

    Hi, my name is Josephine from TopDataList.com

    We are ceasing operations on TopDataList.com and have made our leads available at a discounted price.

    Visit us on TopDataList.com
    Regards,
    Josephine

  7. Bruno Gresswell

    Hello, did you know that there are 241,120 internet directories in the world.

    These websites are what drive traffic to YOUR business.

    Want more traffic? Want more Sales? We can help - today.

    Your website wangwei520.top is listed in only 24 of these directories.

    Get more traffic for your Global audience.

    Our automated system adds your website to all of the directories.

    You can find it here: getlisted.directory/wangwei520.top

    Act today, and we will expedite your listings and waive the processing charge!

  8. Adam Murdock

    Convert wangwei520.top to an app with one click!

    80% of users browse websites from their phones.

    Have the App send out push notifications without any extra marketing costs!

    MakeMySiteMobile.com

  9. Chantal Doyne

    Hello, did you know that there are 241,120 internet directories in the world.

    These websites are what drive traffic to YOUR business.

    Want more traffic? Want more Sales? We can help - today.

    Your website wangwei520.top is listed in only 24 of these directories.

    Get more traffic for your Global audience.

    Our automated system adds your website to all of the directories.

    You can find it here: getlisted.directory/wangwei520.top

    Act today, and we will expedite your listings and waive the processing charge!

    We have a special going on. Use "FRIENDS" on checkout for a 50% discount valid today.

  10. clourgy

    Cialis Levitra Farmacia can i buy cialis without a prescription Cialis Soft Prix

  11. Entenedat

    cialis dosage If you re real with us we ll more than likely happily take the product for review, be persuasive persistent and we ll likely be annoyed and remain unimpressed

  12. Keysler

    cialis prices Comments ratings on the side effects, benefits, and effectiveness of tadalafil oral

  13. experly

    Roman also charges 10 for the same thing priligy dosage We know that when it comes to your health, you want only the best

  14. wainnef

    can i buy priligy in usa Any change in the strength and dosage of the drug is to be done only with the permission of the doctor

  15. Litimitte

    buy generic cialis online cheap The throne of the magician can not be kept now, and it will be fought for later

  16. ruinkix

    Is Cialis or Viagra more effective buy cialis online overnight shipping A total of 427 men who completed the 12-week, placebo-controlled, dose-finding study assessing once-daily tadalafil 2

  17. SokSwette

    cialis prices Our guide to Cialis side effects goes into more detail about the potential side effects associated with Cialis, as well as the steps that you can take to deal with them if you re affected

  18. Nizscoons

    Most reviewers who mixed the two admitted that they refrained from doing this a second time cialis online india

  19. hustype

    Seek medical attention right away if any of these SEVERE side effects occur Severe allergic reactions rash; hives; itching; difficulty breathing; tightness in the chest; swelling of the mouth, face, lips, or tongue increased risk of cancer of the ovaries; over stimulation of the ovaries; spontaneous abortion. when to take clomid

  20. Gearsella

    Our doctor and the head embryologist explained what happened very thoroughly and patiently. metformin and clomid While taking the pills I do get nauseous but I am fine once I stop taking them.

  21. furtuby

    Ok I will take 120mg but would like to start taking them now so I can get a better idea of when I will O come October. tamoxifen for weight loss

  22. ignisse

    Christiansen EH, Frost L, Andreasen F, et al. doxycycline for uti dosage how many days

  23. ziserse

    doxycycline 100 mg capsule pseudodiphtheriticum is a commensal of the human nasopharynx.

  24. FauntyFap

    lasix and breastfeeding intimax fucidin for minor burns Officials don t know where Zachary got the parasite, which usually takes up to a week to cause symptoms

  25. Arrerswaf

    taking lasix but not peeing much We investigated the steady state ss PK effects and safety of olaparib tablet co administered with the anti hormonal agents tamoxifen, anastrozole, or letrozole

  26. Effotte

    buy cialis and viagra online May 27, 2022 Article

  27. ethinny

    To determine the impact of management with Oncotype DX on patient reported anxiety co primary Health Related Quality of Life HRQL outcome prior to screening, after disclosure of test results, and during the randomized trial buy cialis online in usa

  28. Allercext

    com 20 E2 AD 90 20Viagra 20100mg 20How 20Long 20Does 20It 20Last 20 20Jual 20Viagra 20Di 20Tangerang viagra 100mg how long does it last Earlier this year, TD Bank replaced CIBC as the issuer ofthe popular Aeroplan flight rewards Visa card ivermectin for cattle

  29. Allercext

    In the MFP model, absence of LVI was sufficient to counteract the impact of other risk factors, while that could not be achieved with a categorical multivariate model in a prior study ivermectin rosacea FГ©mara tablets was generally well tolerated in 2 controlled clinical trials

  30. nojeddy

    over the counter stromectol Mod Pathol 30 4 549 562

  31. Almobre

    Twenty seven patients completed study therapy, all of whom underwent resection nolvadex Izurieta HS, Thadani N, Shay DK, et al

  32. Epibigo

    buy priligy 60 mg I heard Calcium D Glucarate helps the body to detoxify harmful estrogenic chemicals

  33. Epibigo

    Exercise is great for lowering insulin levels, hormones, and proteins known as growth factors priligy review youtube Multivariable logistic regression models were used to test for multiplicative interactions between genetic variants and current MHT use

  34. Almobre

    The mRNA expression of SFRP1 was lower in cases with deep deletion p 0 long term side effects of tamoxifen

  35. justymn

    doxycycline 100mg twice a day for 7 days Transgenic Mice Overexpressing Neuregulin 1 Model Neurofibroma Malignant Peripheral Nerve Sheath Tumor Progression and Implicate Specific Chromosomal Copy Number Variations in Tumorigenesis

  36. justymn

    buy doxycycline amazon Adverse Event Report

  37. Attaicift

    clomiphene citrate over the counter Discuss the foods you eat and the vitamins you take with your health care professional

  38. Spoiffutt

    Absence of the RET 3 T allele in the MTC patients what does lasix look like

  39. legepunny

    Epub 2021 Mar 20 stromectol 3 mg tablet The changes in the nipple usually indicate an underlying cancer in the breast ducts, often just under the nipple, which has extended onto the surface of the nipple

  40. Spoiffutt

    Marty was a giant in medical oncology, and he will be sorely missed how much lasix can you take

  41. legepunny

    The model revealed non monotonic dependence of ER induced transcriptional response on the expression level of ER, that was confirmed experimentally in four variants of the MCF 7 breast cancer cell line stromectol sales

  42. Attaicift

    clomid fast shipping Providing a complete list of medications to the doctor will help with getting the correct dose established for each individual patient