1 parent ced075f commit 048bcdbCopy full SHA for 048bcdb
1 file changed
goose/configuration.py
@@ -29,6 +29,11 @@
29
30
HTTP_DEFAULT_TIMEOUT = 30
31
32
+AVAILABLE_PARSERS = {
33
+ 'lxml' : Parser,
34
+ 'soupparser': ParserSoup,
35
+}
36
+
37
38
class Configuration(object):
39
@@ -84,6 +89,7 @@ def __init__(self):
84
89
self.additional_data_extractor = None
85
90
86
91
# Parser type
92
+ self.available_parsers = AVAILABLE_PARSERS.keys()
87
93
self.parser_class = 'lxml'
88
94
95
# set the local storage path
@@ -94,7 +100,7 @@ def __init__(self):
100
self.http_timeout = HTTP_DEFAULT_TIMEOUT
101
96
102
def get_parser(self):
97
- return Parser if self.parser_class == 'lxml' else ParserSoup
103
+ return AVAILABLE_PARSERS[self.parser_class]
98
104
99
105
def get_publishdate_extractor(self):
106
return self.extract_publishdate
0 commit comments