08-07-2018, 12:39 AM | #1 |
Member
Posts: 18
Karma: 3134
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. |
08-07-2018, 02:18 AM | #2 |
creator of calibre
Posts: 43,835
Karma: 22666666
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. |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Web Browser is unable to establish a secure connection to this web site" | Glorfindel | Kindle Developer's Corner | 62 | 01-19-2024 12:01 PM |
Browser history and search on the browser address bar? | ItalianUruguayan | Kobo Developer's Corner | 0 | 04-13-2018 05:44 PM |
Unable to Scan | hroberts89436 | Calibre Companion | 4 | 12-11-2016 02:04 PM |
How to stop Tag Browser, Details and Cover Browser from showing on startup? | stuartro | Calibre | 1 | 08-15-2016 11:53 PM |
Unable to get source! | itimpi | Development | 5 | 01-09-2013 12:00 PM |