capybara/queries/selector_query.py
def xpath(self, exact=None):
        """
        Returns the XPath query for this selector.

        Args:
            exact (bool, optional): Whether to exactly match text.

        Returns:
            str: The XPath query for this selector.
        """

        exact = exact if exact is not None else self.exact

        if isinstance(self.expression, AbstractExpression):
            expression = self._apply_expression_filters(self.expression)

            return to_xpath(expression, exact=exact)
        else:
            return str_(self.expression)
def xpath(self, exact=None):
        """
        Returns the XPath query for this selector.

        Args:
            exact (bool, optional): Whether to exactly match text.

        Returns:
            str: The XPath query for this selector.
        """

        exact = exact if exact is not None else self.exact

        if isinstance(self.expression, AbstractExpression):
            expression = self._apply_expression_filters(self.expression)

            return to_xpath(expression, exact=exact)
        else:
            return str_(self.expression)
Returns the XPath query for this selector.

        Args:
            exact (bool, optional): Whether to exactly match text.

        Returns:
            str: The XPath query for this selector.