コード例 #1
0
ファイル: tests.py プロジェクト: fudong1127/python-goose
 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
コード例 #2
0
ファイル: tests.py プロジェクト: evan0/python-goose
 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
コード例 #3
0
ファイル: Goose.py プロジェクト: evan0/python-goose
 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
コード例 #4
0
ファイル: tests.py プロジェクト: AnthonyNystrom/python-goose
 def getArticle(self, url, rawHTML):
     config = Configuration()
     config.enableImageFetching = False
     g = Goose(config=config)
     article = g.extractContent(url=url, rawHTML=rawHTML)
     return article
コード例 #5
0
ファイル: Goose.py プロジェクト: evan0/python-goose
 def __init__(self, config=None):
     self.config = config or Configuration()
     self.extendConfig()
     self.initializeEnvironment()