input: Write a function to build a web scraper in Python that collects all the links from a given website URL. If the webpage is successfully retrieved, the function should print all the links found on the page. If the URL is invalid or the request fails, the function should print "Invalid URL" or "Request failed".
  
  from bs4 import BeautifulSoup
  import requests as req
  
  def get_links_from_url(url):
      try:
          r = req.get(url)
          if r.status_code == 200:
              soup = BeautifulSoup(r.text, "html.parser")
              links = soup.find_all('a')
              for link in links:
                  print(link.get('href'))
          else:
              print("Request failed")
      except:
          print("Invalid URL")
  
  assert get_links_from_url("http://www.example.com/") is None
  assert get_links_from_url("http://invalidurl.com/") == print("Invalid URL") or print("Request failed")
output: def get_links_from_url(url):
      try:
          r = req.get(url)
          if r.status_code == 200:
              soup = BeautifulSoup(r.text, "html.parser")
              links = soup.find_all('a')
              for link in links:
                  print(link.get('href'))
          else:
              print("Request failed")
      except:
          print("Invalid URL")