input: Write a function to create a web crawler in Python that starts from a given website URL and looks for other links on the page, then scrapes the page content. The function should return a list of scraped links.
  def crawl(url):
   visited = set()
   queue = [url] 
   result = []
   
   while queue:
   curr = queue.pop(0)
   visited.add(curr) 
   response = requests.get(curr)
   
   if response.ok:
   soup = BeautifulSoup(response.text, 'html.parser')
   
   # scrape the page here 
   result.append(soup.get_text())
   
   # find all the links
   links = soup.find_all('a', href=re.compile('^http'))
   
   for link in links:
   if link['href'] not in visited:
   queue.append(link['href'])
   
   return result
  
  assert crawl('https://example.com')==["Page content of example.com", "Page content of linked site 1", "Page content of linked site 2"]
  assert crawl('https://another-example.com')==["Page content of another-example.com", "Page content of another linked site"]
  assert crawl('https://invalid-url.com')==[]
output: def crawl(url):
      visited = set()
      queue = [url] 
      result = []
      
      while queue:
          curr = queue.pop(0)
          visited.add(curr) 
          try:
              response = requests.get(curr)
              if response.ok:
                  soup = BeautifulSoup(response.text, 'html.parser')
                  result.append(soup.get_text())
                  links = soup.find_all('a', href=re.compile('^http'))
                  for link in links:
                      if link['href'] not in visited:
                          queue.append(link['href'])
          except:
              pass
      
      return result