65 Star 351 Fork 182

耿直的小爬虫 / Python爬虫

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
爬取酷我音乐网.py 566 Bytes
一键复制 编辑 原始数据 按行查看 历史
import requests
from pyquery import PyQuery as pq
i=str(input('请输入歌曲id:'))
url='http://www.kuwo.cn/yinyue/'+i+'?catalog=yueku2016'
response=requests.get(url).text
doc=pq(response)
wrpa=doc('.lrcItem').text()
cu=wrpa.replace(' ','\n')
p=input('是否把歌曲保存到本地 1是 2不要 3直接打印歌词:')
if p == '1':
u=input('请输入文件名:')
test=u+'.txt'
with open(test,'w')as p:
p.write(cu)
print('保存完毕请到本地查看')
elif p=='3':
print(cu)
else:
print('退出')
Python
1
https://gitee.com/testp2y/python_reptilian.git
git@gitee.com:testp2y/python_reptilian.git
testp2y
python_reptilian
Python爬虫
master

搜索帮助