def crawl_comicbook(site, comicid, chapter_number): comicbook = ComicBook.create_comicbook(site=site, comicid=comicid) chapter = comicbook.Chapter(chapter_number=chapter_number) assert len(chapter.image_urls) > 0 print(chapter.to_dict()) print(comicbook.to_dict()) return comicbook, chapter
def crawl_comicbook(site, comicid, chapter_number): comicbook = ComicBook.create_comicbook(site=site, comicid=comicid) comicbook.start_crawler() chapter = comicbook.Chapter(chapter_number=chapter_number) assert len(chapter.image_urls) > 0 logger.info(chapter.to_dict()) logger.info(comicbook.to_dict()) return comicbook, chapter
def _test_crawl_comicbook(site, comicid=None, chapter_number=1): comicbook = ComicBook.create_comicbook(site=site, comicid=comicid) comicbook.start_crawler() chapter = comicbook.Chapter(chapter_number=chapter_number) assert len(chapter.image_urls) > 0 logger.info(chapter.to_dict()) logger.info(comicbook.to_dict()) result = ComicBook.search(site=site) assert len(result) > 0 return comicbook, chapter
def get_comicbook(site, comicid): return ComicBook.create_comicbook(site=site, comicid=comicid)
def get_comicbook_from_cache(site, comicid): comicbook = ComicBook.create_comicbook(site=site, comicid=comicid) return comicbook