input: Write a function to build a web scraper in Python that collects all the links from a given website URL. The function should return a list of all the links found on the webpage. If the provided URL is invalid or if there are no links, 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.invalidurl.com/")==[]
  assert scrape_links("")==[]
  assert scrape_links("http://www.linkspage.com/")==['http://www.link1.com', 'http://www.link2.com']
output: import requests
  from bs4 import BeautifulSoup
  
  def scrape_links(url):
      try:
          response = requests.get(url)
          response.raise_for_status()
          soup = BeautifulSoup(response.text, 'html.parser')
          links = [a['href'] for a in soup.find_all('a', href=True)]
          return links
      except:
          return []