def __process_goose(self): goose_config = Configuration() goose_config.browser_user_agent = 'Mozilla 5.0' goose_config.enable_image_fetching = True g = Goose(config=goose_config) try: article = g.extract(self.url) if article.top_image.src: self.images = self.get_all_images_from_example_src( article.top_image.src) except (requests.exceptions.ConnectionError, requests.exceptions.ReadTimeout): return None return article
def getConfig(self): config = Configuration() config.enable_image_fetching = False return config