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 take a URL as input, parse the webpage, and extract the required data based on given tags and attributes. If the extraction is successful, return the extracted data in the desired format. If the extraction fails, return an error message.
  
  assert create_web_scraper("<url_of_webpage>").extract_data("a")==["url1", "url2", "url3"]
  assert create_web_scraper("<another_url>").extract_data("img", "src")==["image1.jpg", "image2.jpg"]
  assert create_web_scraper("<invalid_url>").extract_data("a")=="Error: Invalid URL"
  assert create_web_scraper("<url_with_no_data>").extract_data("div", "id='content'")=="No data found"
output: def extract_data(self, tag, attribute=None):
      try:
          response = requests.get(self.url)
          response.raise_for_status()
          soup = BeautifulSoup(response.text, 'html.parser')
          if attribute:
              elements = soup.find_all(tag, **{attribute.split('=')[0]: attribute.split('=')[1].strip("'")})
          else:
              elements = soup.find_all(tag)
          if elements:
              return [element.get(attribute.split('=')[0]) if attribute else element.text for element in elements]
          else:
              return "No data found"
      except requests.exceptions.RequestException:
          return "Error: Invalid URL"