Программа запускается и моментально закрывается
from bs4 import BeautifulSoup
#
import requests
def parse():
URL = 'https://loot.farm/'
HEADERS = {
'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36'
}
response = requests.get(URL, headers = HEADERS)
soup = Beautifulsoup(response.content, 'html.parser')
items = soup.findall('div', class_ = 'it_name NA')
comps = []
for item in items:
comps.append({
'title' : item.find('li', class_ = 'it_name NA').get_text(strip = True),
})
for comp in comps:
print(comp['title'])
parse()