|
|
#1 |
|
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Feb 2015
Device: Kindle
|
Remove child tag
I wonder how to remove all child tag from a parent tag with a particular ID.
I tried to use remove_tag and remove_tag_after, but it seems not working in this way. |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,659
Karma: 28549046
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Implement prepocess_html in your recipe. There you can do anything you like using the full beautifulsoup api
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Junior Member
![]() Posts: 5
Karma: 10
Join Date: Feb 2015
Device: Kindle
|
I would like to remove the text "<br>" inside content attribute of <meta> tag as below:
<h1 id="article-title" class="sub_ex_article-title"> sometext<br> <meta content="sometext<br>" name="title"> </h1> The child is malformed and I can't remove the <br> with prepocess_html, coz BeautifulSoup doesn't seems to work with this malformed HTML. Should I use prepocess_raw_html? And is there any sample code available? How can I remove the whole line of <meta>... name="title"> ? Thanks
Last edited by Apollo Mok; 02-25-2015 at 10:33 PM. |
|
|
|
![]() |
| Tags |
| tag remove |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove this tag? | JayKindle | Recipes | 1 | 03-24-2012 12:21 PM |
| Remove author tag | persiomenezes | Library Management | 3 | 10-26-2011 05:41 PM |
| Is it possible to remove the 'new' tag? | nietsnut | Amazon Kindle | 9 | 08-23-2011 12:39 PM |
| remove tag | alexxxm | Calibre | 1 | 01-18-2010 05:36 AM |