def visit(self, visit_uri):
self.raise_server_error()<EOL>visit_uri = urlparse(visit_uri)<EOL>if capybara.app_host:<EOL><INDENT>uri_base = urlparse(capybara.app_host)<EOL><DEDENT>elif self.server:<EOL><INDENT>uri_base = urlparse("<STR_LIT>".format(self.server.host, self.server.port))<EOL><DEDENT>else:<EOL><INDENT>uri_base = None<EOL><DEDENT>visit_uri = ParseResult(<EOL>scheme=visit_uri.scheme or (uri_base.scheme if uri_base else "<STR_LIT>"),<EOL>netloc=visit_uri.netloc or (uri_base.netloc if uri_base else "<STR_LIT>"),<EOL>path=visit_uri.path,<EOL>params=visit_uri.params,<EOL>query=visit_uri.query,<EOL>fragment=visit_uri.fragment)<EOL>self.driver.visit(visit_uri.geturl())<EOL>
Navigate to the given URL. The URL can either be a relative URL or an absolute URL. The
behavior of either depends on the driver. ::

    session.visit("/foo")
    session.visit("http://google.com")

For drivers which can run against an external application, such as the Selenium driver,
giving an absolute URL will navigate to that page. This allows testing applications running
on remote servers. For these drivers, setting :data:`capybara.app_host` will make the
remote server the default. For example::

    capybara.app_host = "http://google.com"
    session.visit("/")  # visits the Google homepage

Args:
    visit_uri (str): The URL to navigate to.