I'm having an issue scraping the F1 website using BeautifulSoup where I have specified the data I have required using a for loop from the website however I am only retrieving one result instead of all the results within the class.
Below is my following code
import requests
from bs4 import BeautifulSoup
from csv import writer
page = requests.get("https://www.formula1.com/")
soup = BeautifulSoup(page.content, 'html.parser')
data = soup.find_all("div", class_="race-list")
for container in data:
countryname = container.find_all("span", class_="name")
country = countryname[0].text
racetype = container.find_all("span", class_="race-type")
rtype = racetype[0].text
racetime = container.find_all("time", class_="day")
racetimename = racetime[0].text.replace("\n", "").strip()
print(country)
My Current Output -
Australia
Expected Output -
Australia
Bahrain
China
etc
Thanks in advance!