From ae3e32cd21df921218c33989a753423cc8dced6b Mon Sep 17 00:00:00 2001 From: Thomas Wade Date: Tue, 25 Sep 2018 17:22:28 +0930 Subject: [PATCH] Get track URLs --- scrape.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scrape.py b/scrape.py index a1f4591..cc94475 100755 --- a/scrape.py +++ b/scrape.py @@ -55,6 +55,7 @@ class User: following = [] class Track: + url = '' title = None artist = None date = None @@ -141,10 +142,11 @@ def Get_Tracks_Info(url, limit = 100): if track_elem.find(class_='sound__trackList'): continue - # Grab the title + # Grab the title and url title_elem = track_elem.find(class_='soundTitle__title') if title_elem: track.title = title_elem.span.string.strip() + track.url = 'https://soundcloud.com' + title_elem['href'] # Grab who uploaded it (usually the artist unless it's a label) artist_elem = track_elem.find(class_='soundTitle__usernameText')