import requests
from bs4 import BeautifulSoup
URL='https://mel73157.site/live/mortal-kombat/1252965-mortal-kombat-x/'
HEADERS= {'user-agent':'Mozilla / 5.0 (Windows NT 10.0; WOW64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 80.0.3987.132 YaBrowser / 20.3.2.242 Yowser / 2.5 Safari / 537.36'}
def get_html (url, params=None):
r = requests.get(url,headers=HEADERS, params = params)
return r
def get_content(html):
soup= BeautifulSoup(html,'html.parser')
items= soup.find_all('div', class_='centerCon fl')
player=[]
for item in items:
player.append({
'title': item.find('div', class_='date').get_text(),
})
print(player)
def parse():
html = get_html(URL)
if html.ok:
get_content(html.text)
else:
print('Ошибка в запросе')
parse()