input: Write a function to create a web scraper using Python that collects the title and content from the homepage of a given website. The function should accept a URL as input and return a dictionary containing the title and content of the webpage. If the title or content cannot be found, return an empty string for that key in the dictionary.
  assert scrape_homepage('https://www.example.com')=={'title': 'Example Domain', 'content': 'This domain is for use in illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.'}
  assert scrape_homepage('https://www.nonexistentwebsite.com')=={'title': '', 'content': ''}
  assert scrape_homepage('https://www.anotherwebsite.com')=={'title': 'Another Title', 'content': 'This is the content of another website.'}
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 ''
          content = soup.get_text().strip() if soup.get_text() else ''
          return {'title': title, 'content': content}
      except:
          return {'title': '', 'content': ''}