diff --git a/src/calibre/gui2/store/stores/empik_plugin.py b/src/calibre/gui2/store/stores/empik_plugin.py index 8a38ff8709..ae9c61344d 100644 --- a/src/calibre/gui2/store/stores/empik_plugin.py +++ b/src/calibre/gui2/store/stores/empik_plugin.py @@ -58,7 +58,7 @@ class EmpikStore(BasicStoreConfig, StorePlugin): d.exec_() def search(self, query, max_results=10, timeout=60): - url = 'http://www.empik.com/ebooki/ebooki,3501,s?resultsPP=' + str(max_results) + '&q=' + quote(query) + url = 'http://www.empik.com/ebooki/ebooki,3501,s?resultsPP={}&q={}'.format(max_results, quote(query)) br = browser() diff --git a/src/calibre/gui2/store/stores/nexto_plugin.py b/src/calibre/gui2/store/stores/nexto_plugin.py index 74b45241c0..c05f2c2e3f 100644 --- a/src/calibre/gui2/store/stores/nexto_plugin.py +++ b/src/calibre/gui2/store/stores/nexto_plugin.py @@ -57,7 +57,7 @@ class NextoStore(BasicStoreConfig, StorePlugin): counter = max_results while counter: - with closing(br.open(url + '&_offset=' + str(offset), timeout=timeout)) as f: + with closing(br.open(url + '&_offset={}'.format(offset), timeout=timeout)) as f: doc = html.fromstring(f.read()) for data in doc.xpath('//ul[@class="productslist"]/li'): if counter <= 0: @@ -76,7 +76,7 @@ class NextoStore(BasicStoreConfig, StorePlugin): title = re.sub(r' – ebook', '', title) author = ', '.join(data.xpath('.//div[@class="col-7"]//h4//a/text()')) formats = ', '.join(data.xpath('.//ul[@class="formats"]/li//b/text()')) - DrmFree = re.search(r'znak', str(data.xpath('.//ul[@class="formats"]/li//b/@title'))) + DrmFree = re.search(r'znak', type('')(data.xpath('.//ul[@class="formats"]/li//b/@title'))) counter -= 1 diff --git a/src/calibre/gui2/store/stores/publio_plugin.py b/src/calibre/gui2/store/stores/publio_plugin.py index c5fc9b8bf7..da5fdee3bf 100644 --- a/src/calibre/gui2/store/stores/publio_plugin.py +++ b/src/calibre/gui2/store/stores/publio_plugin.py @@ -62,7 +62,7 @@ class PublioStore(BasicStoreConfig, StorePlugin): counter = max_results page = 1 while counter: - with closing(br.open('http://www.publio.pl/e-booki,strona' + str(page) + '.html?q=' + quote(query), timeout=timeout)) as f: # noqa + with closing(br.open('http://www.publio.pl/e-booki,strona{}.html?q={}'.format(page, quote(query)), timeout=timeout)) as f: # noqa doc = html.fromstring(f.read()) for data in doc.xpath('//div[@class="products-list"]//div[@class="product-tile"]'): if counter <= 0: diff --git a/src/calibre/gui2/store/stores/swiatebookow_plugin.py b/src/calibre/gui2/store/stores/swiatebookow_plugin.py index 373dc07a72..ec884e3f09 100644 --- a/src/calibre/gui2/store/stores/swiatebookow_plugin.py +++ b/src/calibre/gui2/store/stores/swiatebookow_plugin.py @@ -63,7 +63,7 @@ class SwiatEbookowStore(BasicStoreConfig, StorePlugin): counter = max_results while counter: - with closing(br.open('https://www.swiatebookow.pl/ebooki/?q=' + quote(query) + '&page=' + str(page), timeout=timeout)) as f: + with closing(br.open('https://www.swiatebookow.pl/ebooki/?q=' + quote(query) + '&page={}'.format(page), timeout=timeout)) as f: doc = html.fromstring(f.read().decode('utf-8')) for data in doc.xpath('//div[@class="category-item-container"]//div[@class="book-large"]'): if counter <= 0: