def __convert_to_ebook(self, book): ebook = Ebook() ebook.title = book.find('.name').text() ebook.author = book.find('.author').text() ebook.cover = book.find('.book-img img').attr('src') ebook.intro = book.find('.intro').text() return ebook
def __convert_to_ebook(self, book): ebook = Ebook() ebook.title = book.get('title', '') ebook.author = self.__get_author(book) ebook.price = book.get('salesPrice', 0.0) / 100.0 ebook.cover = book.get('cover', '') ebook.intro = book.get('abstract', '') return ebook
def __convert_to_ebook(self, book): ebook = Ebook() ebook.title = book.find('.title').text() ebook.author = book.find('.u-author').text() ebook.price = float( book.find('.u-price em').text().replace('¥', '').strip()) ebook.cover = book.find('.cover img').attr('src') ebook.intro = book.find('.desc').text() return ebook
def __convert_to_ebook(self, book): book_info = book.get('bookInfo') if book_info.get('format') != 'epub' or book_info.get('soldout') == 1: return None ebook = Ebook() ebook.title = book_info.get('title', '') ebook.author = book_info.get('author', '') ebook.price = book_info.get('price', 0.0) ebook.cover = book_info.get('cover', '') ebook.intro = book_info.get('intro', '') return ebook