mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Nexto store: remove use of type('') with better xpath
There's no need to run regular expressions on a str(list()) of lxml element results, to see if anything contains a string -- simply use the XPath grammar contains() and check if any results were returned.
This commit is contained in:
parent
448b412c9d
commit
26871566ce
@ -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', type('')(data.xpath('.//ul[@class="formats"]/li//b/@title')))
|
||||
DrmFree = data.xpath('.//ul[@class="formats"]/li//b[contains(@title, "znak")]')
|
||||
|
||||
counter -= 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user