input: Write a function called crawl that takes a URL as an input and performs a web crawling operation. The function should start from the given website, look for other links within the page, and then scrape the page content. Use the requests and BeautifulSoup libraries to handle HTTP requests and HTML parsing, respectively. Only follow links that match the regular expression '^http' and keep track of visited URLs to avoid cycles.
  assert crawl('http://www.example.com')==None
  assert crawl('http://www.anothersite.com')==None
  assert crawl('http://www.invalidurl.com')==None
  assert crawl('http://www.recursivelink.com')==None
  assert crawl('http://www.noextralinks.com')==None
output: import requests
  from bs4 import BeautifulSoup
  import re
  
  def crawl(url):
      visited = set()
      to_visit = [url]
      
      while to_visit:
          current_url = to_visit.pop()
          if current_url in visited:
              continue
          visited.add(current_url)
          
          try:
              response = requests.get(current_url)
              if response.status_code != 200:
                  continue
              
              soup = BeautifulSoup(response.text, 'html.parser')
              for link in soup.find_all('a', href=re.compile('^http')):
                  new_url = link.get('href')
                  if new_url not in visited:
                      to_visit.append(new_url)
          except requests.RequestException:
              continue