From 748172b422b6066d2f1756fe28b033e855aeb357 Mon Sep 17 00:00:00 2001 From: John Schember Date: Thu, 19 Apr 2012 19:58:50 -0400 Subject: [PATCH] Store: Update B&N to work with new site layout. --- src/calibre/gui2/store/stores/bn_plugin.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/calibre/gui2/store/stores/bn_plugin.py b/src/calibre/gui2/store/stores/bn_plugin.py index ab3d39264f..af9168e9ca 100644 --- a/src/calibre/gui2/store/stores/bn_plugin.py +++ b/src/calibre/gui2/store/stores/bn_plugin.py @@ -44,7 +44,7 @@ class BNStore(BasicStoreConfig, StorePlugin): def search(self, query, max_results=10, timeout=60): query = query.replace(' ', '-') - url = 'http://www.barnesandnoble.com/s/%s?store=ebook&sze=%s' % (query, max_results) + url = 'http://www.barnesandnoble.com/s/%s?store=nookstore' % query br = browser() @@ -55,14 +55,14 @@ class BNStore(BasicStoreConfig, StorePlugin): if counter <= 0: break - id = ''.join(data.xpath('.//div[contains(@class, "image")]/a/@href')) + id = ''.join(data.xpath('.//a[contains(@class, "thumb")]/@href')) if not id: continue - cover_url = ''.join(data.xpath('.//div[contains(@class, "image")]//img/@src')) + cover_url = ''.join(data.xpath('.//img[contains(@class, "product-image")]/@src')) - title = ''.join(data.xpath('.//p[@class="title"]//span[@class="name"]/text()')) - author = ', '.join(data.xpath('.//ul[@class="contributors"]//li[position()>1]//a/text()')) - price = ''.join(data.xpath('.//table[@class="displayed-formats"]//a[contains(@class, "bn-price")]/text()')) + title = ''.join(data.xpath('.//a[@class="title"]//text()')) + author = ', '.join(data.xpath('.//a[@class="contributor"]//text()')) + price = ''.join(data.xpath('.//div[@class="price-format"]//span[contains(@class, "price")]/text()')) counter -= 1