mirror of https://github.com/scrapy/scrapy.git
avoid harcoded check for selector type
This commit is contained in:
parent
94c3a345b7
commit
67c98b185b
|
|
@ -17,10 +17,7 @@ __all__ = ['Selector', 'SelectorList']
|
|||
def _st(response, st):
|
||||
if st is None:
|
||||
return 'xml' if isinstance(response, XmlResponse) else 'html'
|
||||
elif st in ('xml', 'html'):
|
||||
return st
|
||||
else:
|
||||
raise ValueError('Invalid type: %s' % st)
|
||||
return st
|
||||
|
||||
|
||||
def _response_from_text(text, st):
|
||||
|
|
|
|||
Loading…
Reference in New Issue