diff --git a/script/packtpub.py b/script/packtpub.py index f3f648e..4a7f7ce 100644 --- a/script/packtpub.py +++ b/script/packtpub.py @@ -98,14 +98,14 @@ def __parseDailyBookInfo(self, soup): def __parseNewsletterBookInfo(self, soup): div_target = soup.find('div', {'id': 'main-book'}) - urlWithTitle = div_target.select('div.promo-landing-book-picture a')[0]['href'] + urlWithTitle = div_target.select('div.nano-book-main-image a')[0]['href'] title = urlWithTitle.split('/')[-1].replace('-', ' ').title() - claimNode = div_target.select('div.promo-landing-book-info a') + claimNode = div_target.select('div.nano-book-text a') self.info['title'] = title self.info['filename'] = title.replace(' ', '_').encode('ascii', 'ignore') - self.info['description'] = div_target.select('div.promo-landing-book-body > div')[0].text.strip() - self.info['url_image'] = 'https:' + div_target.select('div.promo-landing-book-picture img')[0]['src'] + self.info['description'] = div_target.select('div.nano-book-text > div')[0].text.strip() + self.info['url_image'] = 'https:' + div_target.select('div.nano-book-main-image img')[0]['src'] self.info['url_claim'] = self.__url_base + claimNode[0]['href'] # remove useless info self.info.pop('form_build_id', None)