input: Write a function to create a web scraper that utilizes BeautifulSoup to parse webpages and extract specific data from a given website. The extracted data should be converted into the desired format and stored. If the given website URL is invalid or the data cannot be found, return False. Otherwise, return True.
  assert scrape_data("<url_of_webpage>")==True
  assert scrape_data("invalid_url_of_webpage")==False
output: def scrape_data(url):
      try:
          import requests
          from bs4 import BeautifulSoup
          response = requests.get(url)
          if response.status_code != 200:
              return False
          soup = BeautifulSoup(response.content, 'html.parser')
          # Example: Extracting all links from the webpage
          links = soup.find_all('a')
          if not links:
              return False
          # Example: Storing the links in a list
          link_list = [link.get('href') for link in links]
          # Example: Converting the list to a desired format (e.g., JSON)
          import json
          json_data = json.dumps(link_list)
          # Example: Storing the JSON data (e.g., in a file)
          with open('data.json', 'w') as f:
              f.write(json_data)
          return True
      except:
          return False