Skip to content

Instantly share code, notes, and snippets.

@lowweihong
Last active August 31, 2019 04:04
Show Gist options
  • Save lowweihong/8384ae0646888844d81e41f0b82c7c20 to your computer and use it in GitHub Desktop.
Save lowweihong/8384ae0646888844d81e41f0b82c7c20 to your computer and use it in GitHub Desktop.
from bs4 import BeautifulSoup
import wget
soup = BeautifulSoup(r.text, 'lxml')
for node_link in soup.select('tr > td:nth-child(2) > a:nth-child(3)'):
url = node_link['href']
if is_downloadable(url):
wget.download(url,
'./data/' + url.split('&file=')[-1].split('&format')[0] + '.mid')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment