capybara/session.py
def current_path(self):
        """ str: Path of the current page, without any domain information. """

        if not self.current_url:
            return

        path = urlparse(self.current_url).path
        return path if path else None
def current_path(self):
        """ str: Path of the current page, without any domain information. """

        if not self.current_url:
            return

        path = urlparse(self.current_url).path
        return path if path else None
str: Path of the current page, without any domain information.