input: Write a function to create a Python web scraper that collects all the links from a given website URL. The function should take a URL as input, send a GET request to the website, parse the HTML content using BeautifulSoup, and return a list of all the href attributes found in anchor tags.
  
  
  def scrape_links(url):
      import requests as req
      from bs4 import BeautifulSoup
  
      # GET request to the website
      r = req.get(url)
  
      # Parse the HTML content
      soup = BeautifulSoup(r.text, "html.parser")
  
      # Find all anchor tags and extract href attributes
      links = [link.get('href') for link in soup.find_all('a')]
  
      return links
  
  # Test cases
  assert scrape_links("http://www.example.com/") == ['http://www.iana.org/domains/example']
  assert scrape_links("http://www.anothersite.com/") == ['http://www.anothersite.com/page1', 'http://www.anothersite.com/page2']
  assert scrape_links("") == []
  assert scrape_links("http://www.nonexistentwebsite.com/") == []  # Assuming the website does not exist
  
output: def scrape_links(url):
      import requests as req
      from bs4 import BeautifulSoup
  
      try:
          r = req.get(url)
          soup = BeautifulSoup(r.text, "html.parser")
          links = [link.get('href') for link in soup.find_all('a')]
      except:
          links = []
  
      return links