input: Write a function to create a web crawler in Python that starts from a given URL and scrapes the content of the webpage. The crawler should also look for other links on the page and add them to the queue for further scraping. The function should return all visited URLs and their corresponding scraped content.
  import requests
  from bs4 import BeautifulSoup
  import re
  
  def crawl(url):
   visited = {}
   queue = [url] 
   
   while queue:
   curr = queue.pop(0)
   if curr not in visited:
   response = requests.get(curr)
   
   if response.ok:
   soup = BeautifulSoup(response.text, 'html.parser')
   visited[curr] = 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'])
   
   return visited
  
  assert crawl('http://example.com')["http://example.com"].startswith("Example Domain")
output: 
  def crawl(url):
   visited = {}
   queue = [url] 
   
   while queue:
   curr = queue.pop(0)
   if curr not in visited:
   response = requests.get(curr)
   
   if response.ok:
   soup = BeautifulSoup(response.text, 'html.parser')
   visited[curr] = 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'])
   
   return visited
  