11-19-2013, 04:30 PM | #1 |
Hello, I'd like to know w
Posts: 22
Karma: 69062
Join Date: Mar 2012
Device: Kindle 4 NT, Paperwhite 2013
|
Can remove_tags search for div/style value?
Feed: http://feeds.feedburner.com/infosecResources
Sample article: http://resources.infosecinstitute.co...c+Resources%29 I want to remove the "Want to learn more??" boxes from the article. Here's the relevant part of the HTML source code: Code:
<div style="margin:20px 0 25px 0;padding-left:25px;padding-right:25px;background-color:#CEECF5;font-size: medium; border:1px solid"> <strong>Want to learn more?? </strong> The InfoSec [...] Code:
class AdvancedUserRecipe1384894173(BasicNewsRecipe): title = u'test' oldest_article = 15 max_articles_per_feed = 100 auto_cleanup = True feeds = [(u'InfoSec Institute Resources', u'http://feeds.feedburner.com/infosecResources')] remove_tags = [dict(name='div', attrs={'style':'margin:20px 0 25px 0;padding-left:25px;padding-right:25px;background-color:#CEECF5;font-size: medium; border:1px solid'})] |
11-19-2013, 10:34 PM | #2 |
creator of calibre
Posts: 43,962
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Sure it can, see http://www.crummy.com/software/Beaut...mentation.html for details.
However, if you are trying to remove particular text, I suggest you search for that text and then remove its parent tag. You can do that by implementing preprocess_html in your recipe. |
Advert | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
getting rid of images: remove_tags has no effect? | Read&Write | Recipes | 2 | 06-26-2012 01:27 PM |
Priority between keep_only_tags and remove_tags | BruceBerry | Recipes | 1 | 11-19-2011 03:10 PM |
remove_tags does not work | JFS-NMF | Recipes | 1 | 03-04-2011 01:56 PM |
Help Please: remove_tags doesn't work in WSJ Chinese | Jmot | Recipes | 5 | 02-21-2011 04:10 AM |
Mobi TOC style vs ePub style? | phearlez | Kindle Formats | 3 | 04-11-2010 06:35 AM |