![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Nov 2008
Device: prs 505
|
![]()
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 ![]() ![]() |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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) |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() 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!!!!! |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |