by Anonymous » 26 Aug 2025, 09:35
Ich habe versucht, eine Website mit BeautifulSoup zu schaben, und unabhängig von der Methode oder der Auswahl versuche ich, dass sie immer eine leere Liste zurückgibt. Dies sollte die Top 1001 -Songs auf dem Billboard -Diagramm < /p>
drucken
Code: Select all
from bs4 import BeautifulSoup
import requests
date = input("Which year do you want to travel to? Type the date in this format YYYY-MM-DD: ")
response = requests.get("https://www.billboard.com/charts/hot-100/" + date)
soup = BeautifulSoup(response.text, 'html.parser')
song_names_spans = soup.find_all("span", class_="chart-element__information__song")
song_names = [song.getText() for song in song_names_spans]
Ich habe versucht, eine Website mit BeautifulSoup zu schaben, und unabhängig von der Methode oder der Auswahl versuche ich, dass sie immer eine leere Liste zurückgibt. Dies sollte die Top 1001 -Songs auf dem Billboard -Diagramm < /p>
drucken[code]from bs4 import BeautifulSoup
import requests
date = input("Which year do you want to travel to? Type the date in this format YYYY-MM-DD: ")
response = requests.get("https://www.billboard.com/charts/hot-100/" + date)
soup = BeautifulSoup(response.text, 'html.parser')
song_names_spans = soup.find_all("span", class_="chart-element__information__song")
song_names = [song.getText() for song in song_names_spans]
[/code]