Python, Web Scraping [Duplikat]Python

Python-Programme
Anonymous
 Python, Web Scraping [Duplikat]

Post by Anonymous »

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]

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post