Running two different for loops to create two different lists creates two same lists

Viewed 31

I am trying to create two different lists using two for loops, but it creates two identical lists. When I comment out one for loop it creates the list I am trying to get

import requests
from bs4 import BeautifulSoup

locations = dates_list = []
   
url = 'https://www.fis-ski.com/DB/general/statistics.html?statistictype=positions&positionstype=position&offset=50&sectorcode=JP&seasoncode=1980&categorycode=WC&gendercode=&competitornationcode=&place=&nationcode=&position=4&disciplinecode='
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
res = requests.get(url, headers=headers)

soup = BeautifulSoup(res.content, 'html.parser')

venues = soup.find_all('a', attrs={'class': 'bb-xs pb-xs-1_1 g-xs-11 g-sm-6 g-md-4 g-lg-4 justify-left bold'})
dates = soup.find_all('a', attrs={'class': 'bb-xs pb-xs-1_1 pl-xs-1 g-xs-6 g-sm-3 g-md-2 g-lg-2 justify-left'})

for venue in venues:
    locations.append(venue.get_text())
        
for date in dates:
    dates_list.append(date.get_text())

print(locations)
print(dates_list)
1 Answers
Related