1. A method for searching a plurality of objects within ea Document Object Model (DOM) document, the method comprising: receiving an XPath expression, the XPath expression comprising a plurality of attributes and one or more logical operators defining relationships between the attributes, the logical operators comprising one or more of a logical AND, a logical OR, or a logical NOT; generating a tree structure representing the XPath expression, the tree structure comprising a plurality of nodes arranged according to a hierarchical relationship between the attributes based upon positions of the plurality of attributes and the one or more logical operators in the XPath expression, each node in the plurality of nodes representing a group of one or more attributes from the plurality of attributes, the plurality of nodes including a set of leaf nodes that do not have any child nodes; associating a weight value with each node in the plurality of nodes in the tree structure based upon a location of the node in the tree structure, wherein the associating comprises: assigning a weight value to each of the set of leaf nodes based upon the positions of the plurality of attributes corresponding to the set of leaf nodes in the XPath expression; and for each node in the plurality of nodes other than the set of leaf nodes, assigning a weight value to the node based upon weight values assigned to one or more child nodes of the node; for each object in the plurality of objects within the DOM document, calculating a score for the object based on a comparison of one or more attributes of the object to the plurality of attributes within the XPath expression and based upon the weight values associated with the plurality of nodes in the tree structure; determining a target object from the plurality of objects within the DOM document, based on the scores calculated for the plurality of objects; and outputting information related to the target object as a response to the receipt of the XPath expression.
1. A method for searching a plurality of objects within ea Document Object Model (DOM) document, the method comprising: receiving an XPath expression, the XPath expression comprising a plurality of attributes and one or more logical operators defining relationships between the attributes, the logical operators comprising one or more of a logical AND, a logical OR, or a logical NOT; generating a tree structure representing the XPath expression, the tree structure comprising a plurality of nodes arranged according to a hierarchical relationship between the attributes based upon positions of the plurality of attributes and the one or more logical operators in the XPath expression, each node in the plurality of nodes representing a group of one or more attributes from the plurality of attributes, the plurality of nodes including a set of leaf nodes that do not have any child nodes; associating a weight value with each node in the plurality of nodes in the tree structure based upon a location of the node in the tree structure, wherein the associating comprises: assigning a weight value to each of the set of leaf nodes based upon the positions of the plurality of attributes corresponding to the set of leaf nodes in the XPath expression; and for each node in the plurality of nodes other than the set of leaf nodes, assigning a weight value to the node based upon weight values assigned to one or more child nodes of the node; for each object in the plurality of objects within the DOM document, calculating a score for the object based on a comparison of one or more attributes of the object to the plurality of attributes within the XPath expression and based upon the weight values associated with the plurality of nodes in the tree structure; determining a target object from the plurality of objects within the DOM document, based on the scores calculated for the plurality of objects; and outputting information related to the target object as a response to the receipt of the XPath expression. 2. The method of claim 1 , wherein assigning a weight value to each leaf node comprises assigning weight values exponentially based on indexes of each leaf node within the XPath expression.