![]() |
#1 |
Member
![]() Posts: 10
Karma: 12
Join Date: Sep 2010
Device: Kindle 3 3G+Wifi
|
keeping or removing a div with multiple classes
I'm using keep_only_tags and remove_tags in a recipe for a site using divs with multiple classes like so:
Code:
<div class="article right">blah</div> This is what I've tried, but it doesn't work: Code:
keep_only_tags = [ dict(name='div', attrs={'class':['article']}) ] Code:
keep_only_tags = [ dict(name='div', attrs={'class':['article right']}) ] Any one have ideas? |
![]() |
![]() |
![]() |
#2 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
keep_only_tags = [ dict(name='div', attrs={'class':re.compile(r'article', re.DOTALL|re.IGNORECASE)}) ] import re |
|
![]() |
![]() |
Advert | |
|
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Does keeping multiple formats affect performance? | ficbot | Calibre | 3 | 09-18-2010 10:14 PM |
Questions about <p> and <div> and paragraph spacing | droople | Sigil | 7 | 08-14-2010 12:03 PM |
ePub not supported < div > position: absolute | samsgates | ePub | 1 | 06-18-2010 11:22 AM |
Exclude <div>s from processing in HTML2LRF | MTBSJC | Calibre | 1 | 02-13-2009 03:26 AM |
Keeping Multiple Favorites Lists in Synch | Bob Russell | Lounge | 9 | 08-10-2004 03:06 AM |