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 URLs found on the webpage. If the URL is empty or if no links are found, the function should return an empty list.
  assert collect_links("http://www.example.com")==['/link1', '/link2', '/link3']
  assert collect_links("http://www.empty.com")==[]
  assert collect_links("")==[]
output: import requests
  from bs4 import BeautifulSoup
  
  def collect_links(url):
      if not url:
          return []
      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 []