input: Write a function to scrape an online news website to get the headlines. The function should take the URL of the website as an input.
  assert scrape_headlines("https://www.news.com/") == ["Headline 1", "Headline 2", "Headline 3"]
  assert scrape_headlines("https://www.fake-news.com/") == []
  assert scrape_headlines("https://www.empty-news.com/") == []
output: import requests
  from bs4 import BeautifulSoup
  
  def scrape_headlines(url):
      response = requests.get(url)
      if response.status_code != 200:
          return []
      soup = BeautifulSoup(response.content, 'html.parser')
      headlines = soup.find_all('h1')
      return [headline.text for headline in headlines]