View Single Post
Old 05-17-2022, 03:29 AM   #113
iamagloworm
Connoisseur
iamagloworm began at the beginning.
 
Posts: 60
Karma: 10
Join Date: Apr 2013
Device: Kindle Paperwhite 3 (Manga)
I have been trying to figure out how to do this myself, but failing.

worker.py has...

Code:
        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')
And the relevant part of the page it is scraping looks like this:

Code:
<div class="col-lg-8 col-sm-8 mb-20">

                                <ul class="project-details-list">
                                    <li>
                                        <h6>Published:</h6>
                                        <div class="project-terms">
                                            Oct-2014 <small>(Hardcover)</small>                                        </div>
                                    </li>
                                    <li>
                                        <h6>Formats:</h6>
                                        <div class="project-terms">
                                            Print / eBook                                        </div>
                                    </li>																	
                                    <li>
                                        <h6>Rating:</h6>
                                        <div class="project-terms">
 	                                        <svg class="bi text-secondary" width="12" height="12" fill="currentColor"><use xlink:href="../images/fdb-icons.svg#star-fill"></use></svg>
				                    		<svg class="bi text-secondary" width="12" height="12" fill="currentColor"><use xlink:href="../images/fdb-icons.svg#star-fill"></use></svg>
          							        <svg class="bi text-secondary" width="12" height="12" fill="currentColor"><use xlink:href="../images/fdb-icons.svg#star-fill"></use></svg>
       							            <svg class="bi text-secondary" width="12" height="12" fill="currentColor"><use xlink:href="../images/fdb-icons.svg#star-fill"></use></svg>
         						           <svg class="bi text-secondary" width="12" height="12" fill="currentColor"><use xlink:href="../images/fdb-icons.svg#star-fill"></use></svg>                                            	
                                        </div>
                                    </li>	
                                    									
                                                                                                            
                                        <li>
                                            <h6>Pages:</h6>
                                            <div class="project-terms">
                                                40                                            </div>
                                        </li>
                                                                                                                <li>
                                            <h6>Age Level:</h6>
                                            <div class="project-terms">
                                                02-05                                            </div>
                                        </li>

Last edited by iamagloworm; 05-17-2022 at 04:13 AM.
iamagloworm is offline   Reply With Quote