input: Write a python function to scrape product titles and prices from an Amazon page and return them as a dictionary.
  assert scrape_amazon_products('https://www.amazon.com/') == {'Product1': 'Price1', 'Product2': 'Price2'}
  assert scrape_amazon_products('https://www.amazon.com/dp/B08N5WRWNW') == {'Echo Dot (4th Gen)': '49.99', 'Echo Dot Kids': '59.99'}
output: def scrape_amazon_products(url):
      import requests
      from bs4 import BeautifulSoup
  
      headers = {
          'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'}
  
      response = requests.get(url, headers=headers)
      soup = BeautifulSoup(response.content, 'html.parser')
  
      products = {}
      
      for item in soup.select('[data-component-type="s-search-result"]'):
          title = item.h2.get_text(strip=True)
          try:
              price = item.find('span', 'a-price-whole').get_text(strip=True)
              price += item.find('span', 'a-price-fraction').get_text(strip=True)
          except AttributeError:
              price = "Price not available"
          products[title] = price
      
      return products