Connoisseur
Posts: 60
Karma: 10
Join Date: Apr 2013
Device: Kindle Paperwhite 3 (Manga)
|
I tried this, but did not get any result. No tags show at all...
Code:
if cfg.plugin_prefs[cfg.STORE_NAME][cfg.KEY_GET_AGE_LEVEL_AS_TAGS]:
self._append_tags(root, 'Age Level', calibre_tags, '//li/h6[text()[contains(.,"Age Level")]]/../div[@class="project-terms"]/a')
Log: Spoiler:
Code:
#################### Log for The Apple Doll ####################
Running identify query with parameters:
{'title': 'The Apple Doll', 'authors': ['Elisa Kleven'], 'identifiers': {'mobi-asin': 'B006G31EB4'}, 'timeout': 30}
Using plugins: FictionDB (1, 2, 1)
The log from individual plugins is below
****************************** FictionDB (1, 2, 1) ******************************
Found 1 results
Downloading from FictionDB took 1.6465802192687988
---
Title : The Apple Doll
Author(s) : Elisa Kleven
Publisher : Farrar, Straus and Giroux
Published : 2008-08-01T00:00:00+00:00
Identifiers : fictiondb:the-apple-doll~elisa-kleven~328704
Comments : Lizzy loves the big apple tree in her yard more than anything. So when the first day of school comes, she picks a beautiful apple, turns it into a makeshift doll she names Susanna, and takes it along to keep her company. But her teacher tells her that dolls aren't allowed at school. Even worse, her sister says that Susanna won't last forever. Then Lizzy's mom shows her a way to turn Susanna into a real apple doll. And with the help of Susanna the Apple Doll, Lizzy overcomes her shyness at school and makes plenty of new friends to bring home to play in her beloved apple tree. Detailed, delightful collage illustrations accompany this sweet story about one girl's success in bringing together her home world and her school world. Instructions for making an apple doll just like Susanna are included!
create_query - isbn: "None"
Querying: https://www.fictiondb.com/search/searchresults.php - author=Elisa+Kleven&title=The+Apple+Doll&isbn=&datepublished=&synopsis=&rating=-&anthology=&imprint=&pubgroup=&srchtxt=multi&styp=6
Initial search including ISBN found something: 'https://www.fictiondb.com/title/the-apple-doll~elisa-kleven~328704.htm'
_parse_search_results - No first row
FictionDB book url: 'https://www.fictiondb.com/title/the-apple-doll~elisa-kleven~328704.htm'
parse_title: title_node= The Apple Doll
parse_authors: authors_node= Elisa Kleven
parse_publisher - publisher_node: ['\xa0', 'Farrar, Straus and Giroux', 'Hardcover', '0374303800', '9780374303808', '\xa0', 'Farrar, Straus and Giroux', 'eBook', '1466808233', '9781466808232', '\xa0', 'Farrar, Straus and Giroux BYR', 'eBook', '146680341X', '9781466803411', '\xa0', 'Farrar, Straus, and Giroux', 'eBook (Kindle)']
********************************************************************************
The identify phase took 1.82 seconds
The longest time (1.646580) was taken by: FictionDB
Merging results from different sources
We have 1 merged results, merging took: 0.00 seconds
Actually, upon further testing, it seems that no genres/tags are being scraped, even after reverting to your beta.
The same for classification and time period.
Does this work for you?
Log: Spoiler:
Code:
#################### Log for Great expectations ####################
Running identify query with parameters:
{'title': 'Great expectations', 'authors': ['Charles Dickens'], 'identifiers': {'isbn': '9781434000651'}, 'timeout': 30}
Using plugins: FictionDB (1, 2, 1)
The log from individual plugins is below
****************************** FictionDB (1, 2, 1) ******************************
Found 1 results
Downloading from FictionDB took 2.079063892364502
---
Title : Great Expectations
Author(s) : Charles Dickens
Publisher : Createspace
Series : Classic Starts (Sterling) #1
Published : 1862-01-01T00:00:00+00:00
Identifiers : fictiondb:great-expectations~charles-dickens~167194
Comments : Great Expectations is at once a superbly constructed novel of spellbinding mystery and a profound examination of moral values. Written at a time when Dickens' relationship with Victorian society had reached a crisis, this novel is peopled by characters unmistakably bearing Dickens' familiar stamp -- but here they appear in a new and questioning light. The orphan, Pip, and the convict, Magwitch ... the beautiful Estella, and her guardian, the embittered and vengeful Miss Havisham ... the strangely ambiguous figure of the master lawyer, Mr. Jaggers all play their part in a story whose title itself reflects the deep irony that shapes Dickens' searching reappraisal of the Victorian middle class. From the agony of his disenchantment comes a work that gives an added dimension to his matchless genius.
create_query - isbn: "9781434000651"
Querying: https://www.fictiondb.com/search/searchresults.php - author=Charles+Dickens&title=Great+expectations&isbn=9781434000651&datepublished=&synopsis=&rating=-&anthology=&imprint=&pubgroup=&srchtxt=multi&styp=6
_parse_search_results - No first row
No matches found with identifiers, retrying using only title and authors
create_query - isbn: "None"
Querying: https://www.fictiondb.com/search/searchresults.php - author=Charles+Dickens&title=Great+expectations&isbn=&datepublished=&synopsis=&rating=-&anthology=&imprint=&pubgroup=&srchtxt=multi&styp=6
Initial search including ISBN found something: 'https://www.fictiondb.com/title/great-expectations~charles-dickens~167194.htm'
_parse_search_results - No first row
FictionDB book url: 'https://www.fictiondb.com/title/great-expectations~charles-dickens~167194.htm'
parse_title: title_node= Great Expectations
parse_authors: authors_node= Charles Dickens
series_node: series_node found - Classic Starts (Sterling)
parse_publisher - publisher_node: ['\xa0', 'Createspace', 'Trade Paperback', '150861038X', '9781508610380', '\xa0', 'Globe Fearon', 'Paperback', '0822492601', '9780822492603', '\xa0', 'Longman Publishing Group', 'Paperback', '0582530032', '9780582530034', '\xa0', 'Signet', 'Mass Market Paperback', '0451523598', '9780451523594', '\xa0', 'Signet', 'Mass Market Paperback', '0451525248', '9780451525246', '\xa0', 'Signet', 'Mass Market Paperback', '0451520769', '9780451520760', '\xa0', 'MacMillan (UK)', 'Hardcover', '0333046374', '9780333046371', '\xa0', 'Dutton', 'Hardcover', '0460012347', '9780460012348', '\xa0', 'Hart Associates', 'Hardcover', '0805511989', '9780805511987', '\xa0', 'Pendulum Press', 'Hardcover', '0883014009', '9780883014004', '\xa0', 'Pendulum Press', 'Hardcover', '0883014122', '9780883014127', '\xa0', 'Dutton', 'Hardcover', '0130435031', '9780130435033', '\xa0', "St. Martin's", 'eBook', '1466805315', '9781466805316', '\xa0', 'Bantam', 'eBook', '0553897624', '9780553897623', '\xa0', 'Pocket', 'eBook', '1416503005', '9781416503002', '\xa0', 'Pan Macmillan', 'eBook', '1509831304', '9781509831302', '\xa0', 'Sheba Blake Publishing', 'eBook', '1329372603', '9781329372603', '\xa0', 'Diversion Books', 'eBook', '1682300277', '9781682300275', '\xa0', 'DH Audio', 'Audio Cassette', '0886460565', '9780886460563', '\xa0', 'DH Audio', 'Audio Cassette', '0886468035', '9780886468033', '\xa0', 'Audio Literature', 'Audio Cassette', '1558001387', '9781558001381', '\xa0', 'Soundelux Audio Pub', 'Audio Cassette', '0881423688', '9780881423686', '\xa0', 'Books in Motion', 'Audio Cassette', '1556863306', '9781556863301', '\xa0', 'DH Audio', 'Audio Cassette', '0886462908', '9780886462901', '\xa0', 'Ulverscroft Large Print', 'Hardcover', '0708980627', '9780708980620', 'Large Print', '\xa0', 'New Promise Inc', 'Trade Paperback', '1557012121', '9781557012128', 'Large Print', '\xa0', 'Cyber Classics', 'Trade Paperback', '1588550257', '9781588550255', 'Large Print', '\xa0', 'Thorndike Press', 'Hardcover', '078625405X', '9780786254057', 'Large Print', '\xa0', 'Echo Library', 'Paperback', '1847022499', '9781847022493', 'Large Print', '\xa0', 'Createspace', 'Trade Paperback', '149032870X', '9781490328706', 'Large Print']
********************************************************************************
The identify phase took 2.23 seconds
The longest time (2.079064) was taken by: FictionDB
Merging results from different sources
We have 1 merged results, merging took: 0.00 seconds
Edit: for reference, this is the full tags code from worker.py - I wonder if it is using an old method that needs to be updated? Spoiler:
Code:
def parse_tags(self, root):
# FictionDB has multiple optional sections which can be used as tags depending on the user's preference.
calibre_tags = list()
if cfg.plugin_prefs[cfg.STORE_NAME][cfg.KEY_GET_GENRE_AS_TAGS]:
self._append_tags(root, 'Genre', calibre_tags, '//div[@class="row"]/div/div[@class="row"]/div/h4/../ul[@class="tagcloud-list"]')
if cfg.plugin_prefs[cfg.STORE_NAME][cfg.KEY_GET_CLASSIFICATION_AS_TAGS]:
self._append_tags(root, 'Classification', calibre_tags, '//div[@class="row"]/div/div[@class="row"]/div/h4/i[@class="fa fa-table"]/../../ul/li')
if cfg.plugin_prefs[cfg.STORE_NAME][cfg.KEY_GET_TIME_PERIOD_AS_TAGS]:
self._append_tags(root, 'Time Period', calibre_tags, '//div[@class="row"]/div/div[@class="row"]/div/h4/i[@class="fa fa-clock-o"]/../../ul/li')
if len(calibre_tags) > 0:
return calibre_tags
def _append_tags(self, root, group, calibre_tags, xpath_statement):
tags_nodes = root.xpath(xpath_statement)
if tags_nodes:
for tags_node in tags_nodes:
sub_tags_nodes = tags_node.xpath('div/div/ul')
sub_tags_nodes = tags_node.xpath('./li')
if sub_tags_nodes:
for sub_tags_node in sub_tags_nodes:
tag = sub_tags_node.text_content().strip()
if tag and tag not in calibre_tags:
calibre_tags.append(tag)
else:
tag = tags_node.text_content().strip()
if tag and tag not in calibre_tags:
calibre_tags.append(tag)
Last edited by iamagloworm; 05-17-2022 at 04:31 AM.
|