Scraping the Billboard Hot 100

Billboard Hot 100

Search the Songs from Billboard.com

#travel_date = input("which year you want to travel to? Type the date in this format YYYY-MM-DD:")
travel_date = "2022-09-30"
from wsgiref import headers
import requests
from bs4 import BeautifulSoup

billboard_url = f"<https://www.billboard.com/charts/hot-100/{travel_date}/>"

response = requests.get(billboard_url)
soup = BeautifulSoup(response.text,"html.parser")
titles = soup.find_all(name="h3", class_="u-max-width-330")
title_list = [title.getText().strip() for title in titles]
title_list

Creating and Adding to Spotify Playlist

pip install spotipy

Registry and Authenticate with Spotify

1. Registry user account on Spotify.com
2. Get user information from Spotify account <https://developer.spotify.com/dashboard/applications/27ac73ad261c49af85aa148276970037>
3. Copy your client_id and client_sceret from Spotify