input: Write a function to create a web scraper using the BeautifulSoup Python package to extract specific data from a given website URL and return the extracted data in the desired format. If no data is found, return an empty list.
  
  def web_scraper(url, required_tag, required_attribute):
      import requests
      from bs4 import BeautifulSoup
      webpage = requests.get(url)
      soup = BeautifulSoup(webpage.content, 'html.parser')
      elements = soup.find_all(required_tag)
      extracted_data = [element.get(required_attribute) for element in elements if element.has_attr(required_attribute)]
      return extracted_data
  
  assert web_scraper("https://example.com", 'a', 'href') == ['https://example.com/page1', 'https://example.com/page2']
  assert web_scraper("https://example.com/contact", 'p', 'class') == ['paragraph']
  assert web_scraper("https://example.com/404", 'h1', 'id') == []
  assert web_scraper("https://example.com/products", 'img', 'src') == ['https://example.com/image1.jpg', 'https://example.com/image2.jpg']
output: def web_scraper(url, required_tag, required_attribute):
      import requests
      from bs4 import BeautifulSoup
      webpage = requests.get(url)
      soup = BeautifulSoup(webpage.content, 'html.parser')
      elements = soup.find_all(required_tag)
      extracted_data = [element.get(required_attribute) for element in elements if element.has_attr(required_attribute)]
      return extracted_data