input: Write a function to scrape an online news website and extract all the headlines from the webpage. The function should use the `requests` library to fetch the webpage and `BeautifulSoup` from `bs4` to parse the HTML content. The extracted headlines should be printed out. If the website URL is provided as an input, the function should attempt to fetch the webpage and parse the content to find all `h2` elements which generally contain the headlines.
  
  
  def scrape_headlines(url):
      import requests
      from bs4 import BeautifulSoup 
  
      # get the response in the form of html
      r = requests.get(url) 
  
      # create a beautifulsoup object to parse contents 
      soup = BeautifulSoup(r.content, 'html5lib') 
  
      # find headlines from the parsed page  
      headlines = soup.find_all('h2') 
  
      # Print the headlines 
      for headline in headlines: 
          print(headline.text)
  
  scrape_headlines("https://www.news.com/")
   
  
  assert scrape_headlines("https://www.news.com/")
  # Output should be the headlines printed out as text.
  # No return value is expected as the function directly prints the headlines.
output: def scrape_headlines(url):
      import requests
      from bs4 import BeautifulSoup 
  
      r = requests.get(url) 
      soup = BeautifulSoup(r.content, 'html5lib') 
      headlines = soup.find_all('h2') 
  
      for headline in headlines: 
          print(headline.text)