mirror of https://github.com/scrapy/scrapy.git
extract_regex: encoding arg defaults to 'utf-8'
Sometimes it is not neccessary to pass the encoding argument. For example, when the text argument is unicode. So set a default encoding. Signed-off-by: Ping Yin <pkufranky@gmail.com>
This commit is contained in:
parent
90fef3cbcd
commit
0aaa74d2bd
|
|
@ -42,7 +42,7 @@ def load_object(path):
|
|||
|
||||
return obj
|
||||
|
||||
def extract_regex(regex, text, encoding):
|
||||
def extract_regex(regex, text, encoding='utf-8'):
|
||||
"""Extract a list of unicode strings from the given text/encoding using the following policies:
|
||||
|
||||
* if the regex contains a named group called "extract" that will be returned
|
||||
|
|
|
|||
Loading…
Reference in New Issue