input: Write a function to scrape and print all links from a given website URL. If the website is not accessible or the URL is empty, return an empty list.
  assert scrape_links("http://www.example.com/") == ["http://www.example.com/about", "http://www.example.com/contact"]
  assert scrape_links("http://www.nonexistentwebsite.com/") == []
  assert scrape_links("") == []
  assert scrape_links("http://www.example.com/pages/") == ["http://www.example.com/pages/page1", "http://www.example.com/pages/page2"]
output: def scrape_links(url):
      import requests
      from bs4 import BeautifulSoup
      try:
          if not url:
              return []
          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 []