Exemplo n.º 1
0
 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
Exemplo n.º 2
0
 def find_search_results(self, doc):
     return xpath(doc, '//li', 'ProductList__item')
Exemplo n.º 3
0
 def find_search_results(self, doc):
     return xpath(doc, '//*', 'book ')
 def find_search_results(self, doc):
     return xpath(doc, '//*[@itemtype="https://schema.org/Book"]')
Exemplo n.º 5
0
 def find_book_details(self, doc):
     return xpath(doc, '//*[@itemtype="http://schema.org/Product"]')[0]
Exemplo n.º 6
0
 def find_search_results(self, doc):
     return xpath(doc, '//*', 'search-results', '/ul/li')