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 10-08-2011, 06:27 AM   #1
MrJuggles
Junior Member
MrJuggles began at the beginning.
 
MrJuggles's Avatar
 
Posts: 1
Karma: 10
Join Date: Oct 2011
Location: North Wales, UK
Device: Kindle keyboard
A beginners question

Hey everyone
I'm super new to this and have been tinkering around with a few recipes to get articles from publications like Guardian, New Statesman and SFX (so far) It's working out good as I'm only doing the basic stuff. I just wanted to ask a quick question about the code below.
Do I just copy and paste it into my recipes or do I need to change or be aware of.

Quote:
Originally Posted by kiklop74 View Post
Small piece of code to convert all links to text:

Spoiler:
Code:
    def preprocess_html(self, soup):
        for alink in soup.findAll('a'):
            if alink.string is not None:
               tstr = alink.string
               alink.replaceWith(tstr)
        return soup

Last edited by MrJuggles; 10-08-2011 at 06:32 AM. Reason: change thread subscription to instant
MrJuggles is offline   Reply With Quote
Old 10-10-2011, 09:11 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by MrJuggles View Post
Hey everyone
I'm super new to this and have been tinkering around with a few recipes to get articles from publications like Guardian, New Statesman and SFX (so far) It's working out good as I'm only doing the basic stuff. I just wanted to ask a quick question about the code below.
Do I just copy and paste it into my recipes or do I need to change or be aware of.
Read the sticky https://www.mobileread.com/forums/sho...d.php?t=121439 for a summary and links to detailed help. Basically, you just make a copy of the builtin, paste in the code, save the copy, then schedule/run the modified copy.
Starson17 is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A beginners question martheijnens ePub 4 09-27-2011 06:31 AM
Swedish for Beginners is a good one TulagiHotel-HH Reading Recommendations 2 06-13-2010 04:12 AM
Help porting for beginners Gogolo iRex 2 09-03-2009 09:33 AM
Do all beginners..... Stitchawl Introduce Yourself 22 04-10-2009 12:33 AM
Tutorial for beginners? CharlieBird Feedback 9 10-22-2008 09:59 AM


All times are GMT -4. The time now is 10:58 AM.


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