from lxml import etree
import requests
import os
from urllib import request,parse
url = 'https://www.ximalaya.com/lishi/4164479/'
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36'
}
response = requests.get(url,headers=headers)
# print(response)
html = response.text
html_ele = etree.HTML(html)
mp_list = html_ele.xpath('//ul[@class="dOi2"]/li/div[2]/a/@href')
# print(mp_list
Python爬虫 爬取音频文件 #只用于学习
最新推荐文章于 2024-07-15 10:36:04 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)