input: Write a function to create a web scraper that extracts specific data from a given website. The function should utilize the Python package BeautifulSoup to parse webpages and extract the required data, which can then be converted into the desired format and stored. The function should take a URL as input and return the extracted data.
  assert web_scraper("<url_of_webpage>")==["http://example.com/link1", "http://example.com/link2"]
  assert web_scraper("<url_of_another_webpage>")==["http://example2.com/link1", "http://example2.com/link2"]
  assert web_scraper("<url_of_empty_webpage>")==[]
  assert web_scraper("<url_of_malformed_webpage>")==None
output: def web_scraper(url):
      try:
          import requests
          from bs4 import BeautifulSoup
          response = requests.get(url)
          soup = BeautifulSoup(response.text, 'html.parser')
          links = [a['href'] for a in soup.find_all('a', href=True)]
          return links
      except:
          return None