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 all the headlines found on the webpage.
  assert scrape_headlines("https://www.news.com/")==["First Headline", "Second Headline", "Third Headline"]
  assert scrape_headlines("https://www.anothernews.com/")==[]
  assert scrape_headlines("https://www.news.com/business")==["Business First Headline", "Business Second Headline"]
  assert scrape_headlines("")==[]
  assert scrape_headlines("https://www.nonexistenturl.com/")==[]
output: import requests
  from bs4 import BeautifulSoup
  
  def scrape_headlines(url):
      if not url:
          return []
      try:
          response = requests.get(url)
          response.raise_for_status()
      except:
          return []
      soup = BeautifulSoup(response.text, 'html.parser')
      headlines = [h.text.strip() for h in soup.find_all('h1') + soup.find_all('h2') + soup.find_all('h3')]
      return headlines