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 take the target website's URL as an input and return the title and content. If the title or content is not found, return None for that part. Use the 'requests' and 'bs4' (BeautifulSoup) libraries to perform the scraping.
  def web_scraper(url):
      import requests
      import bs4
  
      r = requests.get(url)
      html = bs4.BeautifulSoup(r.text, "html.parser")
  
      title = html.find('title').text if html.find('title') else None
      content = html.find('div', {'class': 'content'}).text if html.find('div', {'class': 'content'}) else None
  
      return title, content
  
  assert web_scraper('https://www.example.com')==('Example Domain', '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 web_scraper('https://www.invalidurl.com')==(None, None)
  assert web_scraper('https://www.missingcontent.com')==('Missing Content', None)
  assert web_scraper('https://www.missingtitle.com')==(None, 'Sample content')
  assert web_scraper('https://www.missingtitleandcontent.com')==(None, None)
output: def web_scraper(url):
      import requests
      import bs4
  
      try:
          r = requests.get(url)
          r.raise_for_status()
          html = bs4.BeautifulSoup(r.text, "html.parser")
  
          title = html.find('title').text if html.find('title') else None
          content = html.find('div', {'class': 'content'}).text if html.find('div', {'class': 'content'}) else None
  
          return title, content
      except:
          return None, None