我想在使用Python的站点中查找所有音频文件,如.mp3、.wav、.ogg、.wma等。 这是我的代码>;>;
url = urllib.request.urlopen(link)
content = url.read()
soup = BeautifulSoup(content)
links = [a['href'] for a in soup.find_all('a',href=re.compile('http.*\.mp3'))]
print (str(len(links)) + " Audios Found ")
# print (links)
print("\n".join(links))
只能找到.mp3链接。 我还需要其他音频链接。
因为您使用regex来选择链接,所以请更改此行
至
相关问题 更多 >
编程相关推荐