chrome/test/chromedriver/util.py
def DoesUrlExist(url):
  """Determines whether a resource exists at the given URL.

  Args:
    url: URL to be verified.

  Returns:
    True if url exists, otherwise False.
  """
  parsed = urllib.parse.urlparse(url)
  try:
    conn = http_client.HTTPConnection(parsed.netloc)
    conn.request('HEAD', parsed.path)
    response = conn.getresponse()
  except http_client.HTTPException:
    return False
  finally:
    conn.close()
  # Follow both permanent (301) and temporary (302) redirects.
  if response.status == 302 or response.status == 301:
    return DoesUrlExist(response.getheader('location'))
  return response.status == 200
Determines whether a resource exists at the given URL.

  Args:
    url: URL to be verified.

  Returns:
    True if url exists, otherwise False.
  
Determines whether a resource exists at the given URL.
Determines whether a resource exists at the given URL .
def DoesUrlExist(url):
  parsed = urllib.parse.urlparse(url)
  try:
    conn = http_client.HTTPConnection(parsed.netloc)
    conn.request('HEAD', parsed.path)
    response = conn.getresponse()
  except http_client.HTTPException:
    return False
  finally:
    conn.close()
  if response.status == 302 or response.status == 301:
    return DoesUrlExist(response.getheader('location'))
  return response.status == 200
def DoesUrlExist ( url ) : parsed = urllib . parse . urlparse ( url ) try : conn = http_client . HTTPConnection ( parsed . netloc ) conn . request ( 'HEAD' , parsed . path ) response = conn . getresponse ( ) except http_client . HTTPException : return False finally : conn . close ( ) if response . status == 302 or response . status == 301 : return DoesUrlExist ( response . getheader ( 'location' ) ) return response . status == 200
Determines whether a resource exists at the given URL.
Determines whether a resource exists at the given URL .
"""Determines whether a resource exists at the given URL.

  Args:
    url: URL to be verified.

  Returns:
    True if url exists, otherwise False.
  """ # Follow both permanent (301) and temporary (302) redirects.
True if url exists, otherwise False.
True if url exists otherwise False .
url
URL to be verified.
URL to be verified .