input: Write a function named scrape_links that collects all the links from a given website URL and returns a list of those links. If the request to the URL fails, the function should 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.anotherwebsite.com/")==["http://www.anotherwebsite.com/page1", "http://www.anotherwebsite.com/page2", "http://www.anotherwebsite.com/page3"]
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) if a['href'].startswith('http')]
          return links
      except:
          return []