<commit_before>from baseparser import BaseParser
from BeautifulSoup import BeautifulSoup


class FocusParser(BaseParser):
    SUFFIX = '?drucken=1'
    domains = ['www.focus.de']

    feeder_pat   = '^http://www.focus.de/(politik|finanzen|gesundheit|wissen|panorama|digital)/.*\.html$'
    feeder_pages = ['http://www.focus.de/']

    def _parse(self, html):
        soup = BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES,
                             fromEncoding='utf-8')

        self.meta = soup.findAll('meta')
        self.source = ', '.join(self.domains)
        self.url = soup.find('meta', {'name': 'og\:url'})['content'] if soup.find('meta', {'name': 'og\:url'}) else self.url
        # category
        keywords = self.url.strip('http://www.focus.de').replace('/', ', ')
        self.category = self.compute_category(keywords if keywords else '')
        #article headline<commit_msg>Missing backslash caught my eye, but did not effect functionality<commit_after>from baseparser import BaseParser
from BeautifulSoup import BeautifulSoup


class FocusParser(BaseParser):
    SUFFIX = '?drucken=1'
    domains = ['www.focus.de']

    feeder_pat   = '^http://www.focus.de/(politik|finanzen|gesundheit|wissen|panorama|digital)/.*\.html$'
    feeder_pages = ['http://www.focus.de/']

    def _parse(self, html):
        soup = BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES,
                             fromEncoding='utf-8')

        self.meta = soup.findAll('meta')
        self.source = ', '.join(self.domains)
        self.url = soup.find('meta', {'name': 'og\:url'})['content'] if soup.find('meta', {'name': 'og\:url'}) else self.url
        # category
        keywords = self.url.strip('http://www.focus.de/').replace('/', ', ')
        self.category = self.compute_category(keywords if keywords else '')
        #article headline
{'fraction_non_alphanumeric': 0.16213333333333332, 'fraction_numerical': 0.0021333333333333334, 'mean_word_length': 3.123076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5239357', 'n_tokens_mistral': 597, 'n_tokens_neox': 582, 'n_words': 106}