input: Write a function to generate a Python code for crawling a website for a specific type of data. The function should take a website URL and the type of data to crawl as inputs, and return the extracted data. The function should use the requests library to fetch the webpage and the re library to find the required data using a regular expression. If the data type is 'phone numbers', the regular expression should match patterns like '123-456-7890'.
  assert crawl_website_for_phone_numbers('www.example.com', 'phone numbers')==['123-456-7890', '987-654-3210']
  assert crawl_website_for_phone_numbers('www.example.com', 'emails')==['example@domain.com', 'info@domain.com']
  assert crawl_website_for_phone_numbers('www.example.com', 'invalid type')==[]
output: def crawl_website_for_phone_numbers(url, data_type):
      import requests
      import re
      
      response = requests.get(url)
      if response.status_code != 200:
          return []
      
      if data_type == 'phone numbers':
          pattern = r'\d{3}-\d{3}-\d{4}'
      elif data_type == 'emails':
          pattern = r'[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}'
      else:
          return []
      
      matches = re.findall(pattern, response.text)
      return matches