Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 02-25-2015, 05:05 AM   #1
Apollo Mok
Junior Member
Apollo Mok began at the beginning.
 
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.
Apollo Mok is offline   Reply With Quote
Old 02-25-2015, 05:12 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,310
Karma: 27111242
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
kovidgoyal is online now   Reply With Quote
Advert
Old 02-25-2015, 09:28 PM   #3
Apollo Mok
Junior Member
Apollo Mok began at the beginning.
 
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 09:33 PM.
Apollo Mok is offline   Reply With Quote
Reply

Tags
tag remove


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to remove this tag? JayKindle Recipes 1 03-24-2012 11:21 AM
Remove author tag persiomenezes Library Management 3 10-26-2011 04:41 PM
Is it possible to remove the 'new' tag? nietsnut Amazon Kindle 9 08-23-2011 11:39 AM
remove tag alexxxm Calibre 1 01-18-2010 04:36 AM


All times are GMT -4. The time now is 07:53 AM.


MobileRead.com is a privately owned, operated and funded community.