View Single Post
Old 08-16-2012, 02:57 AM   #5
lrui
Enthusiast
lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.lrui ought to be getting tired of karma fortunes by now.
 
lrui's Avatar
 
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
Quote:
Originally Posted by kovidgoyal View Post
grep jsbrowser recipes/*

to find the builtin recipe.
thanks for reply, kovid
i find a recipe, but it only has a small piece of code,may be i was too stupid?
do you have further details?

Code:
js_fetcher = '''
import calibre.web.jsbrowser.browser as jsbrowser
def grab(url):
    browser = jsbrowser.Browser()
    #10 second timeout
    browser.visit(url, 10)
    browser.run_for_a_time(10)
    html = browser.html
    browser.close()
    return html
    '''

Last edited by lrui; 08-16-2012 at 03:01 AM.
lrui is offline   Reply With Quote