@@ 4184-4198 (lines=15) @@ | ||
4181 | gocomics = 'http://www.gocomics.com' |
|
4182 | return urljoin_wrapper(gocomics, link['href']) |
|
4183 | ||
4184 | @classmethod |
|
4185 | def get_comic_info(cls, soup, link): |
|
4186 | """Get information about a particular comics.""" |
|
4187 | date_str = soup.find('meta', property='article:published_time')['content'] |
|
4188 | day = string_to_date(date_str, "%Y-%m-%d") |
|
4189 | imgs = soup.find('picture', class_='img-fluid item-comic-image').find_all('img') |
|
4190 | author = soup.find('meta', property='article:author')['content'] |
|
4191 | tags = soup.find('meta', property='article:tag')['content'] |
|
4192 | return { |
|
4193 | 'day': day.day, |
|
4194 | 'month': day.month, |
|
4195 | 'year': day.year, |
|
4196 | 'img': [i['src'] for i in imgs], |
|
4197 | 'author': author, |
|
4198 | 'tags': tags, |
|
4199 | } |
|
4200 | ||
4201 | ||
@@ 2952-2964 (lines=13) @@ | ||
2949 | """Get link to first comics.""" |
|
2950 | return get_soup_at_url(cls.url).find('a', class_='webcomic-link webcomic1-link first-webcomic-link first-webcomic1-link') |
|
2951 | ||
2952 | @classmethod |
|
2953 | def get_comic_info(cls, soup, link): |
|
2954 | """Get information about a particular comics.""" |
|
2955 | title = soup.find('meta', property='og:title')['content'] |
|
2956 | imgs = soup.find('div', class_='webcomic-image').find_all('img') |
|
2957 | date_str = soup.find('meta', property='article:published_time')['content'][:10] |
|
2958 | day = string_to_date(date_str, "%Y-%m-%d") |
|
2959 | return { |
|
2960 | 'title': title, |
|
2961 | 'day': day.day, |
|
2962 | 'month': day.month, |
|
2963 | 'year': day.year, |
|
2964 | 'img': [i['src'] for i in imgs], |
|
2965 | } |
|
2966 | ||
2967 | ||
@@ 2656-2667 (lines=12) @@ | ||
2653 | get_first_comic_link = simulate_first_link |
|
2654 | first_url = NotImplemented |
|
2655 | ||
2656 | @classmethod |
|
2657 | def get_comic_info(cls, soup, link): |
|
2658 | """Get information about a particular comics.""" |
|
2659 | desc = soup.find('meta', property='og:description')['content'] |
|
2660 | title = soup.find('meta', property='og:title')['content'] |
|
2661 | imgs = soup.find('div', class_='entry-content').find_all('img') |
|
2662 | title2 = ' '.join(i.get('title', '') for i in imgs) |
|
2663 | return { |
|
2664 | 'title': title, |
|
2665 | 'title2': title2, |
|
2666 | 'description': desc, |
|
2667 | 'img': [urljoin_wrapper(cls.url, convert_iri_to_plain_ascii_uri(i['src'])) for i in imgs], |
|
2668 | } |
|
2669 | ||
2670 |