input: Write a python function to fetch HTML content from a given URL and parse it using BeautifulSoup to extract all the text and attributes of specified HTML tags.
  assert fetch_and_parse_html('https://www.example.com', 'p') == [{'text': 'Example Domain', 'attrs': {}}]
  assert fetch_and_parse_html('https://www.example.com', 'a') == [{'text': 'More information...', 'attrs': {'href': 'https://www.iana.org/domains/example'}}]
output: def fetch_and_parse_html(url, tag):
      import requests
      from bs4 import BeautifulSoup
      
      response = requests.get(url)
      soup = BeautifulSoup(response.content, 'html.parser')
      
      elements = soup.find_all(tag)
      result = [{'text': element.get_text(), 'attrs': element.attrs} for element in elements]
      
      return result