Exemplo n.º 1
0
 def getArticle(self, url, rawHTML, language=None):
     config = Configuration()
     if language:
         config.targetLanguage = language
         config.useMetaLanguge = False
     config.enableImageFetching = False
     g = Goose(config=config)
     article = g.extractContent(url=url, rawHTML=rawHTML)
     return article
Exemplo n.º 2
0
 def getArticle(self, url, rawHTML, language=None):
     config = Configuration()
     if language:
         config.targetLanguage = language
         config.useMetaLanguge = False
     config.enableImageFetching = False
     g = Goose(config=config)
     article = g.extractContent(url=url, rawHTML=rawHTML)
     return article
Exemplo n.º 3
0
 def extendConfig(self):
     if isinstance(self.config, dict):
         config = Configuration()
         for k, v in self.config.items():
             if hasattr(config, k):
                 setattr(config, k, v)
         self.config = config
Exemplo n.º 4
0
 def getArticle(self, url, rawHTML):
     config = Configuration()
     config.enableImageFetching = False
     g = Goose(config=config)
     article = g.extractContent(url=url, rawHTML=rawHTML)
     return article
Exemplo n.º 5
0
 def __init__(self, config=None):
     self.config = config or Configuration()
     self.extendConfig()
     self.initializeEnvironment()