|
@@ 2920-2932 (lines=13) @@
|
| 2917 |
|
"""Get link to first comics.""" |
| 2918 |
|
return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link') |
| 2919 |
|
|
| 2920 |
|
@classmethod |
| 2921 |
|
def get_comic_info(cls, soup, link): |
| 2922 |
|
"""Get information about a particular comics.""" |
| 2923 |
|
title = soup.find('meta', property='og:title')['content'] |
| 2924 |
|
imgs = soup.find('div', class_='webcomic-image').find_all('img') |
| 2925 |
|
date_str = soup.find('meta', property='article:published_time')['content'][:10] |
| 2926 |
|
day = string_to_date(date_str, "%Y-%m-%d") |
| 2927 |
|
return { |
| 2928 |
|
'title': title, |
| 2929 |
|
'day': day.day, |
| 2930 |
|
'month': day.month, |
| 2931 |
|
'year': day.year, |
| 2932 |
|
'img': [i['src'] for i in imgs], |
| 2933 |
|
} |
| 2934 |
|
|
| 2935 |
|
|
|
@@ 2628-2639 (lines=12) @@
|
| 2625 |
|
get_first_comic_link = simulate_first_link |
| 2626 |
|
first_url = NotImplemented |
| 2627 |
|
|
| 2628 |
|
@classmethod |
| 2629 |
|
def get_comic_info(cls, soup, link): |
| 2630 |
|
"""Get information about a particular comics.""" |
| 2631 |
|
desc = soup.find('meta', property='og:description')['content'] |
| 2632 |
|
title = soup.find('meta', property='og:title')['content'] |
| 2633 |
|
imgs = soup.find('div', class_='entry-content').find_all('img') |
| 2634 |
|
title2 = ' '.join(i.get('title', '') for i in imgs) |
| 2635 |
|
return { |
| 2636 |
|
'title': title, |
| 2637 |
|
'title2': title2, |
| 2638 |
|
'description': desc, |
| 2639 |
|
'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs], |
| 2640 |
|
} |
| 2641 |
|
|
| 2642 |
|
|
|
@@ 2853-2867 (lines=15) @@
|
| 2850 |
|
# prev is next / next is prev |
| 2851 |
|
return last_soup.find('li', class_='previous' if next_ else 'next').find('a') |
| 2852 |
|
|
| 2853 |
|
@classmethod |
| 2854 |
|
def get_comic_info(cls, soup, link): |
| 2855 |
|
"""Get information about a particular comics.""" |
| 2856 |
|
date_str = soup.find('time', class_='published')['datetime'] |
| 2857 |
|
day = string_to_date(date_str, "%Y-%m-%d") |
| 2858 |
|
author = soup.find('span', class_='blog-author').find('a').string |
| 2859 |
|
title = soup.find('meta', property='og:title')['content'] |
| 2860 |
|
imgs = soup.find_all('meta', itemprop='image') |
| 2861 |
|
return { |
| 2862 |
|
'img': [i['content'] for i in imgs], |
| 2863 |
|
'title': title, |
| 2864 |
|
'author': author, |
| 2865 |
|
'day': day.day, |
| 2866 |
|
'month': day.month, |
| 2867 |
|
'year': day.year, |
| 2868 |
|
} |
| 2869 |
|
|
| 2870 |
|
|