Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

avoid harcoded check for selector type

Elias Dorneles67c98b185b4e
diff --git a/scrapy/selector/unified.py b/scrapy/selector/unified.py
index db2a8510a..3c75a92d2 100644
--- a/scrapy/selector/unified.py
+++ b/scrapy/selector/unified.py
@@ -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):