input: Write a function to scrape all the links from a given website URL. The function should return a list of all the links found on the webpage. If the URL is invalid or the webpage cannot be accessed, the function should return an empty list.
  assert scrape_links("http://www.example.com/")==['http://www.example.com/']
  assert scrape_links("http://invalidurl.com/")==[]
  assert scrape_links("")==[]
  assert scrape_links("http://www.google.com/")==['http://www.google.com/']
  assert scrape_links("http://www.example.com/nonexistentpage")==[]
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 = [link.get('href') for link in soup.find_all('a')]
          return links
      except:
          return []