input: Write a function to scrape an online news website to get the headlines. The function should take a URL as input, send a request to the website, parse the HTML content to find all headlines, and print them.
  import requests
  from bs4 import BeautifulSoup 
  
  def scrape_headlines(url): 
      # 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)
  
  assert scrape_headlines("https://www.news.com/")==None
  assert scrape_headlines("https://www.example.com/")==None
output: def scrape_headlines(url): 
      r = requests.get(url) 
      soup = BeautifulSoup(r.content, 'html5lib') 
      headlines = soup.find_all('h2') 
      for headline in headlines: 
          print(headline.text)