mirror of https://github.com/scrapy/scrapy.git
default return value for extract_first
This commit is contained in:
parent
543d02bc64
commit
6b4439eacc
|
|
@ -182,9 +182,9 @@ class SelectorList(list):
|
|||
def extract(self):
|
||||
return [x.extract() for x in self]
|
||||
|
||||
def extract_first(self):
|
||||
def extract_first(self, default=None):
|
||||
for x in self:
|
||||
return x.extract()
|
||||
return x.extract() or default
|
||||
|
||||
@deprecated(use_instead='.extract()')
|
||||
def extract_unquoted(self):
|
||||
|
|
|
|||
Loading…
Reference in New Issue