input: Write a function to create a web scraper that collects the title and content from the homepage of a given website. The function should take a URL as input and return a dictionary containing the title and content extracted from the webpage. If the title or content elements are not found, the corresponding value in the dictionary should be an empty string.
  assert scrape_title_content('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_title_content('https://www.nonexistenturl.com')=={'title': '', 'content': ''}
output: def scrape_title_content(url):
      import requests
      from bs4 import BeautifulSoup
      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': ''}