input: Write a function to scrape all the links from a given website URL and return a list of the links. The function should handle GET requests and use BeautifulSoup to parse the webpage. If the URL is invalid or the page cannot be accessed, the function should return an empty list.
  assert scrape_links("http://www.example.com/")==['http://www.iana.org/domains/example']
  assert scrape_links("http://www.invalidwebsite.com/")==[]
  assert scrape_links("http://www.no-links-here.com/")==[]
  assert scrape_links("")==[]
output: def scrape_links(url):
      import requests
      from bs4 import BeautifulSoup
      try:
          response = requests.get(url)
          if response.status_code == 200:
              soup = BeautifulSoup(response.text, 'html.parser')
              links = [a['href'] for a in soup.find_all('a', href=True)]
              return links
          else:
              return []
      except:
          return []