Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 08-07-2018, 01:39 AM   #1
atl068
Junior Member
atl068 began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Oct 2016
Device: Onyx Boox m96
Unable to use select_form in mechanized browser

My university uses OKTA for authentication, and then it allows me to access many journals, e.g. NEJM. So, for example, https://www.nejm.org.ezproxy.flinders.edu.au will allow me to read all of the journal articles in New England Journal of Medicine. NEJM has a great RSS feed and I like to use it with Calibre. Alas, the built-in recipe is for direct subscribers.

Thus, I tried to modify the script. However, I ran into a problem. For OKTA, the form doesn't have a "name" but has only an "id". So the br.select_form(name="login") in the built-in script will fail and I can't change it to any other name. The form id appears to be "form17". Looking at the mechanized browser in python, I should be able to use alternative methods like: looking for form with a class containing some names, or the Nth form using nr=17 etc. However, when I use anything other than select_form(name=xxxx), Calibre fails saying that it was unexpected. What am I doing wrong? I just can't figure it out. I tried google and forum searching for referring to the form id instead of name, etc... but to no avail.

Thanks.
atl068 is offline   Reply With Quote
Old 08-07-2018, 03:18 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: 33,595
Karma: 10209526
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
IIRC you should just be able to do

select_form(id="whatever")

Make sure you calibre version is up-to-date however, since I added that facility to mechanize relatively recently.
kovidgoyal is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Browser history and search on the browser address bar? ItalianUruguayan Kobo Developer's Corner 0 04-13-2018 06:44 PM
"Web Browser is unable to establish a secure connection to this web site" Glorfindel Kindle Developer's Corner 49 05-30-2017 10:35 AM
Unable to Scan hroberts89436 Calibre Companion 4 12-11-2016 03:04 PM
How to stop Tag Browser, Details and Cover Browser from showing on startup? stuartro Calibre 1 08-16-2016 12:53 AM
Unable to get source! itimpi Development 5 01-09-2013 01:00 PM


All times are GMT -4. The time now is 09:01 PM.


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