def parse_book_details(self, node): r = SearchResult() r.title = text(node, '//*', 'product-page__title', '/text[1]') r.author = text(node, '//*', 'u-m-t--1 deci') r.price = text(node, '//*', 'product-page__pricing') + ' kr' r.cover_url = text(node, '//div', 'product-image', '/img/@src') details = xpath(node, '//dl', 'product-page__facts')[0] for item in xpath(details, './dt'): name = text(item, '.') if 'Filformat' == name: r.formats = text(item, './following-sibling::dd[1]') r.drm = r.formats return r
def find_search_results(self, doc): return xpath(doc, '//li', 'ProductList__item')
def find_search_results(self, doc): return xpath(doc, '//*', 'book ')
def find_search_results(self, doc): return xpath(doc, '//*[@itemtype="https://schema.org/Book"]')
def find_book_details(self, doc): return xpath(doc, '//*[@itemtype="http://schema.org/Product"]')[0]
def find_search_results(self, doc): return xpath(doc, '//*', 'search-results', '/ul/li')