def test_finds_nodes_by_the_given_css_selector(self): xpath = to_xpath(x.css("#preference p")) results = self.find_all(xpath) self.assertEqual(results[0].text, "allamas") self.assertEqual(results[1].text, "llama")
def _find_css(self, css): xpath = to_xpath(x.css(css)) return self._find_xpath(xpath)
def test_is_composable(self): xpath = to_xpath(x.css("#moar").descendant("p")) results = self.find_all(xpath) self.assertEqual(results[0].text, "chimp") self.assertEqual(results[1].text, "flamingo")
def _find_css(self, css): return self._find_xpath(to_xpath(x.css(css)))
def _find_css(self, css): elements = self.browser.dom.xpath(to_xpath(x.css(css))) return [Node(self, element) for element in elements]