input: Write a function that creates a web scraper using Python to collect the title and content from the homepage of a given website. The function should accept a URL as input and return the title and content as a dictionary. If either the title or content is not found, the corresponding key in the dictionary should have a value of None.
  assert scrape_homepage('https://www.example.com') == {'title': 'Example Domain', 'content': 'This domain is for use in illustrative examples in documents.'}
  assert scrape_homepage('https://www.invalidurl.com') == {'title': None, 'content': None}
  assert scrape_homepage('https://www.example.com') == {'title': 'Example Domain', 'content': None}  # Suppose the content is missing
  assert scrape_homepage('https://www.example.com') == {'title': None, 'content': 'This domain is for use in illustrative examples in documents.'}  # Suppose the title is missing
  assert scrape_homepage('') == {'title': None, 'content': None}  # Empty URL input
output: import requests
  from bs4 import BeautifulSoup
  
  def scrape_homepage(url):
      try:
          response = requests.get(url)
          response.raise_for_status()
          soup = BeautifulSoup(response.text, 'html.parser')
          title = soup.title.string if soup.title else None
          content = soup.get_text().strip() if soup.get_text() else None
          return {'title': title, 'content': content}
      except:
          return {'title': None, 'content': None}