input: Write a python function to extract the title, headlines, and links from a given URL using BeautifulSoup.
  assert extract_data('https://www.example.com/') == {'title': 'Example Domain', 'headlines': ['Example Headline 1', 'Example Headline 2'], 'links': ['https://www.iana.org/domains/example', 'https://www.example.com/more']}
  assert extract_data('https://www.anotherexample.com/') == {'title': 'Another Example Domain', 'headlines': ['Another Example Headline 1', 'Another Example Headline 2'], 'links': ['https://www.iana.org/domains/another-example', 'https://www.anotherexample.com/more']}
output: def extract_data(url):
      import requests
      from bs4 import BeautifulSoup
  
      response = requests.get(url)
      soup = BeautifulSoup(response.content, 'html.parser')
  
      title = soup.title.string if soup.title else ''
      headlines = [h.get_text() for h in soup.find_all(['h1', 'h2', 'h3'])]
      links = [a['href'] for a in soup.find_all('a', href=True)]
  
      return {'title': title, 'headlines': headlines, 'links': links}