Answer the question
In order to leave comments, you need to log in
How to parse apple music?
0
def applemusic():
appleMusicUrl = f"https://music.apple.com/ua/search?term={songName}"
appleMusicUrl = appleMusicUrl.replace(" ", "%20")
response = requests.get(appleMusicUrl)
html = response.text
soup = BeautifulSoup(html, "html.parser")
songTab = soup.select_one('div[class="search__top-results"]').text
# nameofSong = songTab.select_one('li:first-child')
# artist = songTab.select_one('li:nth-child(2)')
file.write("Apple Music songs from Finder: \n" + songTab + "\n===========\n")
print(songTab)
applemusic()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question