Нужно спарсить матчи из сегодняшнего дня с HLTV.ORG но нет уникального класса
Хочу пропарсить HLTV.
Как видно на картинке, есть матчи, разделенные на 2 дня. В этих колонках есть класс upcomingMatchesSection но он разбит на каждую колонку т.е. нет уникального класса с которого можно было бы списать данный класс.
Как я могу спарсить только 1 колонку?
from urllib import request, parse, error
from datetime import date, datetime, timedelta
from bs4 import BeautifulSoup
def test():
matches_page = request.urlopen(request.Request("https://www.hltv.org/matches", headers={'User-Agent': 'Chrome'})).read().decode("utf-8")
upcomingMatches = BeautifulSoup(matches_page, "lxml").find("div", {'class', "upcomingMatchesWrapper"})
if upcomingMatches is None:
return []
else:
teams = [line.getText() for line in upcomingMatches.find_all("div", {'class', "matchTeamName text-ellipsis"})]
matches = [(team1, team2) for team1, team2 in tuple(zip(teams, teams[1:]))[::2]]
upcomingMatchContainer = upcomingMatches.find_all("div", {'class', "upcomingMatchesSection"})
# stars = [line.get('stars') for line in upcomingMatchContainer]
time = [line.getText() for line in upcomingMatches.find_all("div", {'class', "matchTime"})]
return [{'teams': teams, 'time': time, } for teams, time in zip(matches, time)]
if __name__ == "__main__":
test()
