Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 11-07-2008, 05:15 AM   #1
arandaalex
Junior Member
arandaalex began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2008
Device: prs 505
Exclamation Recipe - only <p> tags Possible???

I would like to create e few recipes but do not know python well enough to just take information located within the h1 and p tags.

If this was possible calibre would become a really powerful tool. Does anyone know the correct command for this to happen???

Please let me know!!!! I will post all recipes that I come up with if someone would just tell me how to do this!!!!!!!

ANYONE KNOW!!!??????????????

Thanks londres
arandaalex is offline   Reply With Quote
Old 11-07-2008, 02:41 PM   #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,339
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
soup = self.index_to_soup(raw_html)
text = [ self.tag_to_string(tag) for tag in soup.findAll(['h1', 'p'])]
text = '\n'.join(text)
kovidgoyal is offline   Reply With Quote
Advert
Old 11-10-2008, 10:42 AM   #3
arandaalex
Junior Member
arandaalex began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2008
Device: prs 505
Thanks for that pointer what i should have said is that I am completely new to python!!!!

This does not work for me if you could show me an example I would be able to work it out but as it is it is impossible for me!!!

For example pcworld:

RSS: http://www.pcworld.com/article/

Print version: http://www.pcworld.com/printable/article/id

How could I get the H1 and P tags from the print version of pcworld???? I would be eternally grateful if you could show me just this one example!!!!!
arandaalex is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tags gone again ccowie Calibre 5 07-26-2010 01:53 PM
recipe tags adenbley Calibre 3 10-07-2009 09:43 AM
<br /> Tags ghostyjack Sigil 5 09-14-2009 07:08 AM
Using tags HarryT Calibre 1 08-18-2009 07:09 AM
Tags pcmedic Sony Reader 7 02-19-2009 09:36 AM


All times are GMT -4. The time now is 06:55 PM.


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