input: Write a function that builds a web scraper in Python to collect all the links from a given website URL. The function should take a URL as input and print all the links found on that webpage.
  def scrape_links(url):
      import requests as req 
      from bs4 import BeautifulSoup 
        
      # GET request 
      r = req.get(url) 
        
      # parse the downloaded homepage and grab all text
      soup = BeautifulSoup(r.text, "html.parser") 
        
      # find and print all links 
      links = soup.find_all('a') 
      for link in links: 
          print(link.get('href'))
  
  assert scrape_links("http://www.example.com/") is None
  assert scrape_links("http://invalidurl.com/") is None
output: def scrape_links(url):
      import requests as req 
      from bs4 import BeautifulSoup 
        
      try:
          # GET request 
          r = req.get(url) 
            
          # parse the downloaded homepage and grab all text
          soup = BeautifulSoup(r.text, "html.parser") 
            
          # find and print all links 
          links = soup.find_all('a') 
          for link in links: 
              print(link.get('href'))
      except:
          pass