import requests
from bs4 import BeautifulSoup

# Make a request
page = requests.get(
    "https://codedamn-classrooms.github.io/webscraper-python-codedamn-classroom-website/"
)
soup = BeautifulSoup(page.content, "html.parser")

# Create top_items as empty list
top_items = []

# Extract and store in top_items according to instructions on the left
products = soup.select("div.thumbnail")
print("Liczba top items = ", len(products))
for elem in products:
    title = elem.select("h4 > a.title")[0].text
    review_label = elem.select("div.ratings")[0].text
    info = {"title": title.strip(), "review": review_label.strip()}
    top_items.append(info)

print(top_items)