def _token_list_matches_tree(self, token_list):
        """
        Returns whether the token list matches the HTML tree

        :param selector: A Token list to check
        :type selector: list of Token objects
        :returns: True if the token list has matches in self.tree
        :rtype: bool
        """
        try:
            parsed_selector = cssselect.parse(
                ''.join(token.as_css() for token in token_list))[0]

            return bool(
                self.tree.xpath(
                    self.xpath_translator.selector_to_xpath(parsed_selector)))
        except:
            # On error, assume the selector matches the tree
            return True
def _token_list_matches_tree ( self , token_list ) : try : parsed_selector = cssselect . parse ( '' . join ( token . as_css ( ) for token in token_list ) ) [ 0 ] return bool ( self . tree . xpath ( self . xpath_translator . selector_to_xpath ( parsed_selector ) ) ) except : return True
Returns whether the token list matches the HTML tree

        :param selector: A Token list to check
        :type selector: list of Token objects
        :returns: True if the token list has matches in self.tree
        :rtype: bool