input: Write a function to scrape an online news website to get the headlines. The function should take a URL as input and return a list of headlines as output.
  assert scrape_headlines("https://www.news.com/")==["Headline 1", "Headline 2", "Headline 3"]
  assert scrape_headlines("https://www.anothernews.com/")==["Another Headline 1", "Another Headline 2"]
  assert scrape_headlines("https://www.emptynews.com/")==[]
  assert scrape_headlines("")==[]
output: def scrape_headlines(url):
      if not url:
          return []
      try:
          from bs4 import BeautifulSoup
          import requests
          response = requests.get(url)
          soup = BeautifulSoup(response.text, 'html.parser')
          headlines = [h1.text for h1 in soup.find_all('h1')]
          return headlines
      except:
          return []