input: Write a function to build a web scraper in Python that collects all the links from a given website. Return the collected links as a list. If the website cannot be accessed or there are no links, return an empty list.
  assert scrape_links("http://www.example.com/") == ['http://www.example.com/page1', 'http://www.example.com/page2']
  assert scrape_links("http://www.nonexistentwebsite.com/") == []
  assert scrape_links("http://www.example.com/nolinks") == []
  assert scrape_links("http://www.example.com/empty") == []
  assert scrape_links("") == []
output: def scrape_links(url):
      try:
          import requests
          from bs4 import BeautifulSoup
          response = requests.get(url)
          if response.status_code != 200:
              return []
          soup = BeautifulSoup(response.text, 'html.parser')
          links = [a['href'] for a in soup.find_all('a', href=True)]
          return links
      except:
          return []