improve format detection for Gandalf store

This commit is contained in:
Tomasz Długosz 2011-12-15 21:56:43 +01:00
parent e582da8207
commit c9800add54

View File

@ -56,8 +56,8 @@ class GandalfStore(BasicStoreConfig, StorePlugin):
cover_url = ''.join(data.xpath('.//img/@src')) cover_url = ''.join(data.xpath('.//img/@src'))
title = ''.join(data.xpath('.//div[@class="info"]/h3/a/@title')) title = ''.join(data.xpath('.//div[@class="info"]/h3/a/@title'))
formats = title.split() formats = ''.join(data.xpath('.//div[@class="info"]/p[1]/text()'))
formats = formats[-1] formats = re.findall(r'\((.*?)\)',formats)[0]
author = ''.join(data.xpath('.//div[@class="info"]/h4/text() | .//div[@class="info"]/h4/span/text()')) author = ''.join(data.xpath('.//div[@class="info"]/h4/text() | .//div[@class="info"]/h4/span/text()'))
price = ''.join(data.xpath('.//h3[@class="promocja"]/text()')) price = ''.join(data.xpath('.//h3[@class="promocja"]/text()'))
price = re.sub('PLN', '', price) price = re.sub('PLN', '', price)