def _wrap_element_script_result(self, arg): if isinstance(arg, list): return [self._wrap_element_script_result(e) for e in arg] elif isinstance(arg, dict): return {k: self._wrap_element_script_result(v) for k, v in iter(arg.items())} elif isinstance(arg, WebElement): return Node(self, arg) else: return arg
def _find_xpath(self, xpath): return [ Node(self, element) for element in self.browser.find_elements_by_xpath(xpath) ]
def _find_css(self, css): return [ Node(self, element) for element in self.browser.find_elements_by_css_selector(css) ]