Commit 714a0e76 authored by Vincent Paredes's avatar Vincent Paredes Committed by Romain Bignon

matching content with url using is_here

parent 0008cf17
......@@ -198,7 +198,17 @@ class URL(object):
m = self.match(response.url)
if m:
return self.klass(self.browser, response, m.groupdict())
page = self.klass(self.browser, response, m.groupdict())
if hasattr(page, 'is_here'):
if callable(page.is_here):
if page.is_here():
return page
else:
assert isinstance(page.is_here, basestring)
if page.doc.xpath(page.is_here):
return page
else:
return page
def id2url(self, func):
r"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment