input: Write a function to create a web scraper that extracts specific data from a given website using the Python package BeautifulSoup. The function should parse webpages, find HTML elements using tags and attributes, and convert the extracted data into the desired format and store it. If the function is given an empty website URL or an invalid webpage, it should return an empty list.
  assert web_scraper("<url_of_webpage>") == ["<extracted_url_1>", "<extracted_url_2>"]
  assert web_scraper("") == []
  assert web_scraper("<invalid_url>") == []
output: def web_scraper(url):
      try:
          import requests
          from bs4 import BeautifulSoup
          response = requests.get(url)
          if response.status_code != 200:
              return []
          soup = BeautifulSoup(response.content, 'html.parser')
          elements = soup.find_all('a', href=True)
          extracted_urls = [elem['href'] for elem in elements]
          return extracted_urls
      except:
          return []