MCPcopy
hub / github.com/scrapy/scrapy / test_restrict_xpaths

Method test_restrict_xpaths

tests/test_linkextractors.py:226–231  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

224 assert not lx.matches("http://blah2.com/blah2")
225
226 def test_restrict_xpaths(self):
227 lx = self.extractor_cls(restrict_xpaths=('//div[@id="subwrapper"]',))
228 assert list(lx.extract_links(self.response)) == [
229 Link(url="http://example.com/sample1.html", text=""),
230 Link(url="http://example.com/sample2.html", text="sample 2"),
231 ]
232
233 def test_restrict_xpaths_encoding(self):
234 """Test restrict_xpaths with encodings"""

Callers

nothing calls this directly

Calls 2

LinkClass · 0.90
extract_linksMethod · 0.45

Tested by

no test coverage detected