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 07-23-2014, 12:47 PM   #1
Steven630
Groupie
Steven630 began at the beginning.
 
Posts: 176
Karma: 10
Join Date: May 2012
Device: Kindle Paperwhite2
Need Help with Login

How should I write a recipe to log into the following page:
https://membership.chosun.com/login/index_n.jsp

Is this right? I tried, but it doesn't seem to work.

Code:
    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([('USER', self.username), ('PASSWORD', self.password),])
            response = br.open('https://membership.chosun.com/login/index_n.jsp', request)
        return br
I've also tried the code below. Still not working. Articles that don't require login download well. But premium articles that needs login are left out.

Code:
    def get_browser(self):
        br = BasicNewsRecipe.get_browser(self)
        if self.username is not None and self.password is not None:
            br.open('http://membership.chosun.com/login/index_n.jsp')
            br.select_form(name='dizzologinform')
            br['USER']   = self.username
            br['PASSWORD'] = self.password
            br.submit()
        return br

Last edited by Steven630; 07-23-2014 at 12:57 PM.
Steven630 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
login Steven630 Recipes 3 07-21-2012 11:18 AM
Can't login to the online store :( Valwit Sony Reader 3 04-03-2010 08:05 AM
Kindle for PC login fix pk2 Amazon Kindle 2 02-13-2010 07:59 AM
Kindle Login rubikscube99 Amazon Kindle 20 03-12-2009 07:19 PM


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


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