Code Duplication    Length = 12-15 lines in 3 locations

comics.py 3 locations

@@ 4319-4333 (lines=15) @@
4316
        gocomics = 'http://www.gocomics.com'
4317
        return urljoin_wrapper(gocomics, link['href'])
4318
4319
    @classmethod
4320
    def get_comic_info(cls, soup, link):
4321
        """Get information about a particular comics."""
4322
        date_str = soup.find('meta', property='article:published_time')['content']
4323
        day = string_to_date(date_str, "%Y-%m-%d")
4324
        imgs = soup.find('picture', class_='img-fluid item-comic-image').find_all('img')
4325
        author = soup.find('meta', property='article:author')['content']
4326
        tags = soup.find('meta', property='article:tag')['content']
4327
        return {
4328
            'day': day.day,
4329
            'month': day.month,
4330
            'year': day.year,
4331
            'img': [i['src'] for i in imgs],
4332
            'author': author,
4333
            'tags': tags,
4334
        }
4335
4336
@@ 3003-3015 (lines=13) @@
3000
        """Get link to first comics."""
3001
        return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link')
3002
3003
    @classmethod
3004
    def get_comic_info(cls, soup, link):
3005
        """Get information about a particular comics."""
3006
        title = soup.find('meta', property='og:title')['content']
3007
        imgs = soup.find('div', class_='webcomic-image').find_all('img')
3008
        date_str = soup.find('meta', property='article:published_time')['content'][:10]
3009
        day = string_to_date(date_str, "%Y-%m-%d")
3010
        return {
3011
            'title': title,
3012
            'day': day.day,
3013
            'month': day.month,
3014
            'year': day.year,
3015
            'img': [i['src'] for i in imgs],
3016
        }
3017
3018
@@ 2707-2718 (lines=12) @@
2704
    get_first_comic_link = simulate_first_link
2705
    first_url = NotImplemented
2706
2707
    @classmethod
2708
    def get_comic_info(cls, soup, link):
2709
        """Get information about a particular comics."""
2710
        desc = soup.find('meta', property='og:description')['content']
2711
        title = soup.find('meta', property='og:title')['content']
2712
        imgs = soup.find('div', class_='entry-content').find_all('img')
2713
        title2 = ' '.join(i.get('title', '') for i in imgs)
2714
        return {
2715
            'title': title,
2716
            'title2': title2,
2717
            'description': desc,
2718
            'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs],
2719
        }
2720
2721