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 08-15-2012, 10:20 AM   #1
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
conversion error, how to set selct_form

I created a recipe for nfzm and I was trying to be able to login into my account to download news to my nook2.
first i set the form name to (nr = 0),but I got a conversion error, so I changed the Form Name to (nr = 1) still got the same error.

Anyone help me?, any help will be appreciate

I post the source code blow the conversion error,

conversion error
Quote:
抓取新闻来源于 南方周末
Resolved conversion options
calibre version: 0.8.64
{'asciiize': False,
'author_sort': None,
'authors': None,
'base_font_size': 0,
'book_producer': None,
'change_justification': 'original',
'chapter': None,
'chapter_mark': 'pagebreak',
'comments': None,
'cover': None,
'debug_pipeline': None,
'dehyphenate': True,
'delete_blank_paragraphs': True,
'disable_font_rescaling': False,
'dont_download_recipe': False,
'dont_split_on_page_breaks': True,
'duplicate_links_in_toc': False,
'enable_heuristics': False,
'epub_flatten': False,
'extra_css': None,
'extract_to': None,
'filter_css': None,
'fix_indents': True,
'flow_size': 260,
'font_size_mapping': None,
'format_scene_breaks': True,
'html_unwrap_factor': 0.4,
'input_encoding': None,
'input_profile': <calibre.customize.profiles.InputProfile object at 0x0326B270>,
'insert_blank_line': False,
'insert_blank_line_size': 0.5,
'insert_metadata': False,
'isbn': None,
'italicize_common_cases': True,
'keep_ligatures': False,
'language': None,
'level1_toc': None,
'level2_toc': None,
'level3_toc': None,
'line_height': 0,
'linearize_tables': False,
'lrf': False,
'margin_bottom': 5.0,
'margin_left': 5.0,
'margin_right': 5.0,
'margin_top': 5.0,
'markup_chapter_headings': True,
'max_toc_links': 50,
'minimum_line_height': 120.0,
'no_chapters_in_toc': False,
'no_default_epub_cover': False,
'no_inline_navbars': False,
'no_svg_cover': False,
'output_profile': <calibre.customize.profiles.NookOutput object at 0x0326B670>,
'page_breaks_before': None,
'prefer_metadata_cover': False,
'preserve_cover_aspect_ratio': False,
'pretty_print': True,
'pubdate': None,
'publisher': None,
'rating': None,
'read_metadata_from_opf': None,
'remove_fake_margins': True,
'remove_first_image': False,
'remove_paragraph_spacing': False,
'remove_paragraph_spacing_indent_size': 1.5,
'renumber_headings': True,
'replace_scene_breaks': '',
'search_replace': None,
'series': None,
'series_index': None,
'smarten_punctuation': False,
'sr1_replace': '',
'sr1_search': '',
'sr2_replace': '',
'sr2_search': '',
'sr3_replace': '',
'sr3_search': '',
'tags': None,
'test': False,
'timestamp': None,
'title': None,
'title_sort': None,
'toc_filter': None,
'toc_threshold': 6,
'unsmarten_punctuation': False,
'unwrap_lines': True,
'use_auto_toc': False,
'verbose': 2}
InputFormatPlugin: Recipe Input running
Using proxies: {'http': '127.0.0.1:8087'}
Python function terminated unexpectedly
no form matching name 'loginname' (Error Code: 1)
Traceback (most recent call last):
File "site.py", line 132, in main
File "site.py", line 109, in run_entry_point
File "site-packages\calibre\utils\ipc\worker.py", line 192, in main
File "site-packages\calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert
File "site-packages\calibre\ebooks\conversion\plumber.py", line 979, in run
File "site-packages\calibre\customize\conversion.py", line 239, in __call__
File "site-packages\calibre\ebooks\conversion\plugins\recipe_ input.py", line 104, in convert
File "site-packages\calibre\web\feeds\news.py", line 777, in __init__
File "<string>", line 182, in get_browser
File "site-packages\mechanize-0.2.4-py2.7.egg\mechanize\_mechanize.py", line 524, in select_form
mechanize._mechanize.FormNotFoundError: no form matching name 'loginname'
this
Code:
<div class="singin">
  <form id="loginForm">
    <div class="signinTitle">
    <span id="logTips" class="regTips"></span>
   </div>
    <ul class="inputBox">
     <li class="loginname">
      <label>userID/email</label>
      <input type="text" onfocus="hideTips(jQuery('#nameInput'))" value="" maxlength="30" name="loginname" id="nameInput" style="background-color: #C0FF40;">
     </li>
     <li class="password">
      <label>password</label>
      <input type="password" onfocus="hideTips(jQuery('#pwdInput'))" value="" maxlength="16" name="password" id="pwdInput" style="background-color: #C0FF40;">
      
     </li>
     <li id="chechbox">
      <p class="tip">
       <input type="checkbox" checked="checked" name="remember">
       <span>remember me</span>
       <span class="forgetPwd"><a href="http://passport.infzm.com/passport/resetPassWord">  forget password </a></span>
      </p>
     </li>
     <li class="submit clearfix">
         <input type="submit" onclick="login(jQuery('#loginForm'));return false" value="login" title="submit" id="submitbutton">
     </li>
    </ul>
  </form>
 </div>
lrui is offline   Reply With Quote
Old 08-15-2012, 10:27 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: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
That looks like it uses javascript to login. javascript logins are not currently supported in calibre, you can try sniffing the http traffic and creating your own requests with mechanize to mimic it, but that is not easy.

You can also use the in-progress jsbrowser calibre module to implement your recipe, I believe there is one builtin recipe that does this. But again, it wont be easy.
kovidgoyal is offline   Reply With Quote
Old 08-15-2012, 10:49 AM   #3
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
That looks like it uses javascript to login. javascript logins are not currently supported in calibre, you can try sniffing the http traffic and creating your own requests with mechanize to mimic it, but that is not easy.

You can also use the in-progress jsbrowser calibre module to implement your recipe, I believe there is one builtin recipe that does this. But again, it wont be easy.
any tutorial and name of the recipe,thx
lrui is offline   Reply With Quote
Old 08-15-2012, 11:43 PM   #4
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: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
grep jsbrowser recipes/*

to find the builtin recipe.
kovidgoyal is offline   Reply With Quote
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
Old 08-16-2012, 03:00 AM   #6
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: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
No, I dont. As I said jsbrowser is incomplete, the only documentation available for it is in the source code.
kovidgoyal is offline   Reply With Quote
Old 08-17-2012, 10:44 AM   #7
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
No, I dont. As I said jsbrowser is incomplete, the only documentation available for it is in the source code.
thanks anyway, i have figured out the problem via load cookies with other‘s help

Last edited by lrui; 08-22-2012 at 08:49 AM.
lrui is offline   Reply With Quote
Old 08-22-2012, 06:02 AM   #8
flightonair
Junior Member
flightonair began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Dec 2011
Device: Kindle 3
Quote:
Originally Posted by lrui View Post
thanks anyway, i have figured this problem out via load cookies with other‘s help
Could you share me the code and the procedure how to auto login? I'm a newbie for Calibre receipe. I love read infzm very week, but it cannot automatically fetch the articles to my kindle 3 device.

Thanks.
flightonair is offline   Reply With Quote
Old 08-22-2012, 09:11 AM   #9
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 flightonair View Post
Could you share me the code and the procedure how to auto login? I'm a newbie for Calibre receipe. I love read infzm very week, but it cannot automatically fetch the articles to my kindle 3 device.

Thanks.
Code:
needs_subscription = True
def get_browser(self):
        br = BasicNewsRecipe.get_browser(self)
        if self.username is not None and self.password is not None:
            cookies = mechanize.CookieJar()
            br = mechanize.build_opener(mechanize.HTTPCookieProcessor(cookies))
            request = urllib.urlencode([('loginname', self.username), ('password', self.password),])
            response = br.open('http://passport.infzm.com/passport/login', request)
        return br

Last edited by lrui; 08-22-2012 at 09:46 AM.
lrui is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Could not set data error message thetimewarp Calibre 1 08-02-2012 09:15 PM
bulk conversion - set / confirm input format cybmole Conversion 3 02-23-2011 05:28 AM
Conversion error colly Calibre 2 06-12-2010 02:27 AM
Conversion Error athena416 Calibre 0 10-04-2009 02:45 AM
Set defaults for conversion problem Amalthia Calibre 2 04-24-2009 02:12 AM


All times are GMT -4. The time now is 02:20 PM.


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