input: Write a function to create a web crawler in Python that starts from a given URL and looks for other links on the page, scraping the content of each page visited. The function should return a list of URLs of all visited pages.
  import requests
  from bs4 import BeautifulSoup
  import re
  
  def crawl(url):
   visited = set()
   queue = [url] 
   result = []
   
   while queue:
   curr = queue.pop(0)
   if curr in visited:
   continue
   visited.add(curr) 
   response = requests.get(curr)
   
   if response.ok:
   soup = BeautifulSoup(response.text, 'html.parser')
   result.append(curr)
  
  # 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('http://example.com')==['http://example.com', 'http://example.com/about', 'http://example.com/contact']
  assert crawl('http://anotherexample.com')==['http://anotherexample.com', 'http://anotherexample.com/services']
  assert crawl('http://nonexistingurl.com')==[]
  assert crawl('http://example.com/privacy')==['http://example.com/privacy']
  assert crawl('http://nonexistingurl.com/path')==[]
output: 
  def crawl(url):
   visited = set()
   queue = [url] 
   result = []
   
   while queue:
   curr = queue.pop(0)
   if curr in visited:
   continue
   visited.add(curr) 
   response = requests.get(curr)
   
   if response.ok:
   soup = BeautifulSoup(response.text, 'html.parser')
   result.append(curr)
  
  # 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
  