08-15-2012, 10:20 AM | #1 | |
Enthusiast
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:
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> |
|
08-15-2012, 10:27 AM | #2 |
creator of calibre
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. |
08-15-2012, 10:49 AM | #3 | |
Enthusiast
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
Quote:
|
|
08-15-2012, 11:43 PM | #4 |
creator of calibre
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
grep jsbrowser recipes/*
to find the builtin recipe. |
08-16-2012, 02:57 AM | #5 |
Enthusiast
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
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. |
08-16-2012, 03:00 AM | #6 |
creator of calibre
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.
|
08-17-2012, 10:44 AM | #7 |
Enthusiast
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
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. |
08-22-2012, 06:02 AM | #8 | |
Junior Member
Posts: 1
Karma: 10
Join Date: Dec 2011
Device: Kindle 3
|
Quote:
Thanks. |
|
08-22-2012, 09:11 AM | #9 | |
Enthusiast
Posts: 49
Karma: 475062
Join Date: Aug 2012
Device: nook simple touch
|
Quote:
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. |
|
|
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 |