input: from typing import Set
  
  def crawl(url: str) -> Set[str]:
      """Crawls a website starting from the given URL and continues to explore links found on visited pages.
      The function returns a set of all unique URLs that have been visited.
  
      >>> crawl('http://example.com')
      {'http://example.com', 'http://example.com/about', 'http://example.com/contact'}
      """
output:     visited = set()
      to_visit = {url}
  
      while to_visit:
          current_url = to_visit.pop()
          if current_url not in visited:
              visited.add(current_url)
              try:
                  response = requests.get(current_url)
                  if response.status_code == 200:
                      soup = BeautifulSoup(response.text, 'html.parser')
                      for link in soup.find_all('a', href=True):
                          absolute_url = urljoin(current_url, link['href'])
                          if absolute_url.startswith(url):
                              to_visit.add(absolute_url)
              except requests.RequestException:
                  continue
  
      return visited