@@ 2918-2930 (lines=13) @@ | ||
2915 | """Get link to first comics.""" |
|
2916 | return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link') |
|
2917 | ||
2918 | @classmethod |
|
2919 | def get_comic_info(cls, soup, link): |
|
2920 | """Get information about a particular comics.""" |
|
2921 | title = soup.find('meta', property='og:title')['content'] |
|
2922 | imgs = soup.find('div', class_='webcomic-image').find_all('img') |
|
2923 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
2924 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2925 | return { |
|
2926 | 'title': title, |
|
2927 | 'day': day.day, |
|
2928 | 'month': day.month, |
|
2929 | 'year': day.year, |
|
2930 | 'img': [i['src'] for i in imgs], |
|
2931 | } |
|
2932 | ||
2933 | ||
@@ 2626-2637 (lines=12) @@ | ||
2623 | get_first_comic_link = simulate_first_link |
|
2624 | first_url = NotImplemented |
|
2625 | ||
2626 | @classmethod |
|
2627 | def get_comic_info(cls, soup, link): |
|
2628 | """Get information about a particular comics.""" |
|
2629 | desc = soup.find('meta', property='og:description')['content'] |
|
2630 | title = soup.find('meta', property='og:title')['content'] |
|
2631 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
2632 | title2 = ' '.join(i.get('title', '') for i in imgs) |
|
2633 | return { |
|
2634 | 'title': title, |
|
2635 | 'title2': title2, |
|
2636 | 'description': desc, |
|
2637 | 'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs], |
|
2638 | } |
|
2639 | ||
2640 |