# DefaultExtractor XX
# ArticleExtractor # Support Chinese
# ArticleSentencesExtractor # Almost One Sentence a line
# KeepEverythingExtractor XX
# KeepEverythingWithMinKWordsExtractor XX
# LargestContentExtractor
# NumWordsRulesExtractor X # Include some comments
# CanolaExtractor X # Include some front-end dynamic elements
from boilerpipe.extract import Extractor
import ssl
ssl._create_default_https_context = ssl._create_unverified_context


class MyBoiler:
    def __init__(self):
        pass

    def my_boiler(self, strategy='ArticleExtractor'):
        print('------ Start Program ------')
        print(strategy)
        print('------ Extract Text ------')
        try:
            print(Extractor(extractor=strategy, url=self).getText())
        except:
            pass
        # extractor = Extractor(extractor=strategy, url=url, kMin=1) # KeepEverythingWithMinKWordsExtractor, (default)kMin=1
        print('------ Finish ------')

    link = 'https://www.theedgemarkets.com/article/ubg-deal-why-jho-low-teamed-taib-and-later-had-buy-him-out-1mdb-money'
    my_boiler(link, 'ArticleExtractor')

# DefaultExtractor XX
# ArticleExtractor # Support Chinese
# ArticleSentencesExtractor # Almost One Sentence a line
# KeepEverythingExtractor XX
# KeepEverythingWithMinKWordsExtractor XX
# LargestContentExtractor
# NumWordsRulesExtractor X # Include some comments
# CanolaExtractor X # Include some front-end dynamic elements
from boilerpipe.extract import Extractor
import ssl
ssl._create_default_https_context = ssl._create_unverified_context


class MyBoiler:
    def __init__(self):
        pass

    def my_boiler(self, strategy='ArticleExtractor'):
        print('------ Start Program ------')
        print(strategy)
        print('------ Extract Text ------')
        try:
            print(Extractor(extractor=strategy, url=self).getText())
        except:
            pass
        # extractor = Extractor(extractor=strategy, url=url, kMin=1) # KeepEverythingWithMinKWordsExtractor, (default)kMin=1
        print('------ Finish ------')

    link = 'https://www.theedgemarkets.com/article/ubg-deal-why-jho-low-teamed-taib-and-later-had-buy-him-out-1mdb-money'
    my_boiler(link, 'ArticleExtractor')

# DefaultExtractor XX # ArticleExtractor # Support Chinese # ArticleSentencesExtractor # Almost One Sentence a line # KeepEverythingExtractor XX # KeepEverythingWithMinKWordsExtractor XX # LargestContentExtractor # NumWordsRulesExtractor X # Include some comments # CanolaExtractor X # Include some front-end dynamic elements # extractor = Extractor(extractor=strategy, url=url, kMin=1) # KeepEverythingWithMinKWordsExtractor, (default)kMin=1