def test_xpathselector(self): with warnings.catch_warnings(record=True): hs = XPathSelector(text=self.text) self.assertEqual( hs.select("//div").extract(), [u'<div><img src="a.jpg"><p>Hello</p></div>']) self.assertRaises(RuntimeError, hs.css, 'div')
def test_xpathselector(self): with warnings.catch_warnings(): warnings.simplefilter('ignore', ScrapyDeprecationWarning) hs = XPathSelector(text=self.text) self.assertEqual(hs.select("//div").extract(), [u'<div><img src="a.jpg"><p>Hello</p></div>']) self.assertRaises(RuntimeError, hs.css, 'div')
def test_xpathselector(self): with warnings.catch_warnings(): warnings.simplefilter('ignore', ScrapyDeprecationWarning) hs = XPathSelector(text=self.text) self.assertEqual( hs.select("//div").extract(), [u'<div><img src="a.jpg"><p>Hello</p></div>']) self.assertRaises(RuntimeError, hs.css, 'div')
def test_xpathselector(self): with warnings.catch_warnings(record=True): hs = XPathSelector(text=self.text) self.assertEqual(hs.select("//div").extract(), [u'<div><img src="a.jpg"><p>Hello</p></div>']) self.assertRaises(RuntimeError, hs.css, 'div')