|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import requests
def main():
url = input("请输入目标网址:")
txt = get_data(url)
with open("data.txt", "w", encoding="utf-8") as file:
file.write(txt.text)
def get_data(url):
head = {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36',
'referer':'https://music.163.com/song?id=465921195&fromSimiSong=1'
}
params ='Y8nO66zZh / 2IzFXtuK6bsVF / LEjSKKMV46QgvOa5876BWZO3yR4VQitxiMY65KPmZsi26NWQ5xViEbKId8l/xxXa56vin44MBJQvHyXMzDLLRDowxVjXRSoAaAaD5bjgUFQePVrTgMcTrRRnUp7eiQdge2NW1gTufGeUJRt3AW4pyGHUFpRt3oB9yLHG1jFSOfqtRhw6rCKfxyfDxI5RWf4rY6+93vgtEmMRWmas8t8qDefXXiP14CdbgfH0H0U+qqSfEP59rHsLIhF2r9szeJr1agidyibyTfstM1F/QvOKftmcr+EacDxUu0MK6feX+mysYpfopdfHerVIMDsc2kM2h1k9FYfgJFWkc5q3g8o='
encSecKey = '12ed0bfae8fdfea2d974253b87b6ae7d87f8d8c90adb9a5834e57a58a0300467124f559ce79c2157872668411f6a03e1c852d1e248407194e1fc2700b7fb67422e167c397552c760f0df0b9746d3652582e8a3eb361884493777a20443bd992ea9fffaa0bcbcede4ae5eb76661d80dbb4faa619545a2022df3382c6c99e97449'
data = {
'params':params,
'encSecKey':encSecKey
}
html = requests.get(url,headers=head,data = data)
return html
if __name__ == '__main__':
main()
为什么得到的文档是空白的,用小甲鱼的源码也得不到。
我每次用requests都得不到想要的内容 |
|