mirror of https://github.com/scrapy/scrapy.git
minor change to offsite middleware regex, for clarity (doesn't change behaviour)
This commit is contained in:
parent
f3c6d83ad3
commit
1d351c2866
|
|
@ -31,7 +31,7 @@ class OffsiteMiddleware(object):
|
|||
def get_host_regex(self, domains):
|
||||
"""Override this method to implement a different offsite policy"""
|
||||
domains = [d.replace('.', r'\.') for d in domains]
|
||||
regex = r'^(|.*\.)(%s)$' % '|'.join(domains)
|
||||
regex = r'^(.*\.)?(%s)$' % '|'.join(domains)
|
||||
return re.compile(regex)
|
||||
|
||||
def domain_opened(self, spider):
|
||||
|
|
|
|||
Loading…
Reference in New Issue