Similar to ElementTree.Element.find()
188509
def find(self, name):
        
        elt = self.element.find('s3:{}'.format(name), _S3_NS)
        return S3Element(self.root_name, elt) if elt is not None else None
1304509
def find(content = nil, &block)
      if content and block_given?
        raise "TreeNode::find - passed content AND block"
      end

      if content
        if content.class == Regexp
          block = proc { |l| l.content =~ content }
        else
          block = proc { |l| l.content == content }
        end
      end
      return self if block.call(self)

      leaf = @leaves.find { |l| block.call(l) }
      return leaf if leaf

      @children.each do |child|
        node = child.find &block
        return node if node
      end
      nil
    end
28944
function findByNodeName(el, nodeName) {
  if (!el.prop) { // not a jQuery or jqLite object -> wrap it
    el = angular.element(el)
  }

  if (el.prop('nodeName') === nodeName.toUpperCase()) {
    return el
  }

  const c = el.children()
  for (let i = 0; c && i < c.length; i++) {
    const node = findByNodeName(c[i], nodeName)
    if (node) {
      return node
    }
  }
}
29059
private TreeElement findNodeRecurse(String fullName, String currentName)
    {
        String remainingName = null;

        if ((currentName == null) || (fullName == null)) {
            return null;
        }
        if (getName().equals(fullName)) {
            return this;
        }
        if (currentName.indexOf('.') > 0) {
            remainingName = currentName.substring(currentName.indexOf('.') + 1);
            int nextIndex = -1;
            if (remainingName.indexOf(".") > -1) {
                nextIndex = new Integer(remainingName.substring(0, remainingName.indexOf('.'))).intValue();
            }
            else {
                nextIndex = new Integer(remainingName).intValue();
            }

            TreeElement child = getChild(nextIndex);
            if (child != null) {
                return child.findNodeRecurse(fullName, remainingName);
            }
            else {
                return null;
            }
        }
        return null;
    }
990142
def find_element_by_xpath(self, xpath):
        
        elems = self.find_elements_by_xpath(xpath)
        if isinstance(elems, list) and len(elems) > 0:
            return elems[0]
1308251
function scanChildren(element) {
        var found;
        if (element) {
          for (var i = 0, len = element.length; i < len; i++) {
            var target = element[i];
            if (!found) {
              for (var j = 0, numChild = target.childNodes.length; j < numChild; j++) {
                found = found || scanTree([target.childNodes[j]]);
              }
            }
          }
        }
        return found;
      }
1090337
function findNode(name, root) {
        var i, stack, node;
        if (root === null || root === undefined) { return null; }
        stack = [root];
        while (stack.length > 0) {
            node = stack.pop();
            if (node.name === name) {
                return node;
            }
            for (i = node.children.length - 1; i >= 0; i -= 1) {
                stack.push(node.children[i]);
            }
        }
        return null;
    }
861389
def _find_web_element(self):
        """"""
        if not self._web_element or not self.config.getboolean_optional('Driver', 'save_web_element'):
            # If the element is encapsulated we use the shadowroot tag in yaml (eg. Shadowroot: root_element_name)
            if self.shadowroot:
                if self.locator[0] != By.CSS_SELECTOR:
                    raise Exception('Locator type should be CSS_SELECTOR using shadowroot but found: '
                                    '%s'.format(self.locator[0]))
                # querySelector only support CSS SELECTOR locator
                self._web_element = self.driver.execute_script('return document.querySelector("%s").shadowRoot.'
                                                               'querySelector("%s")' % (self.shadowroot,
                                                                                        self.locator[1]))
            else:
                # Element will be finded from parent element or from driver
                base = self.utils.get_web_element(self.parent) if self.parent else self.driver
                # Find elements and get the correct index or find a single element
                self._web_element = base.find_elements(*self.locator)[self.order] if self.order else base.find_element(
                    *self.locator)
508902
def getElement(self, node, name, nsuri=None, default=join):
        """"""
        nsmatch = self.nsUriMatch
        ELEMENT_NODE = node.ELEMENT_NODE
        for child in node.childNodes:
            if child.nodeType == ELEMENT_NODE:
                if ((child.localName == name or name is None) and
                    (nsuri is None or nsmatch(child.namespaceURI, nsuri))
                    ):
                    return child
        if default is not join:
            return default
        raise KeyError, name
807288
def find_elements_by_jquery(browser, selector):
    """"""
    try:
        return browser.execute_script("""return ($ || jQuery)(arguments[0]).get();""", selector)
    except WebDriverException as e:
        if e.msg.startswith(u'$ is not defined'):
            load_script(browser, "//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js")
            return browser.execute_script("""return ($ || jQuery)(arguments[0]).get();""", selector)
        else:
            raise
605885
def findNode(class_, hot_map, targetNode, parentNode=None):
        '''  '''
        for index, (rect, node, children) in enumerate(hot_map):
            if node == targetNode:
                return parentNode, hot_map, index
            result = class_.findNode(children, targetNode, node)
            if result:
                return result
        return None
1063554
private XmlElementFinder getElementFinder(final Element element) {
		if (elementFinder == null) {
			elementFinder = new XmlElementFinder(element.getDocument());
		}
		return elementFinder;
	}
1278697
def find(self, name):
        
        for c in self.children:
            if c.name == name:
                return c
            result = c.find(name)
            if result:
                return result
906140
function find(obj, node, parent) {
  if (!obj) return;
  var result;

  var types = Object.keys(obj);
  for (var i = 0; i < types.length; i++) {
    var type = types[i];

    if (t.is(type, node)) {
      var fn = obj[type];
      result = fn(node, parent);
      if (result != null) break;
    }
  }

  return result;
}
611236
function findChildContainingNode(root, node) {
  const parentNode = node.parentNode;
  return parentNode === root ?
    node :
    findChildContainingNode(root, parentNode);
}
798575
public static Element getChild( Element root, String name )
    {
        if( null == root )
        {
            return null;
        }
        NodeList list = root.getElementsByTagName( name );
        int n = list.getLength();
        if( n < 1 )
        {
            return null;
        }
        return (Element) list.item( 0 );
    }
536465
public boolean searchElement(String elementName) throws XMLException, IOException {
		try {
			do {
				if (Type.START_ELEMENT.equals(event.type)) {
					if (event.text.equals(elementName))
						return true;
				}
				next();
			} while (true);
		} catch (EOFException e) {
			return false;
		}
	}