This commit is contained in:
Kovid Goyal 2010-09-07 18:30:23 -06:00
parent 556ed59e96
commit d156b38449

View File

@ -26,13 +26,13 @@ class NYTimes(BasicNewsRecipe):
#TO LOGIN #TO LOGIN
def get_browser(self): def get_browser(self):
br = BasicNewsRecipe.get_browser() br = BasicNewsRecipe.get_browser()
br.open('http://content.nejm.org/cgi/login?uri=/') br.open('http://www.nejm.org/action/showLogin?uri=http://www.nejm.org/')
br.select_form(nr=0) br.select_form(name='frmLogin')
br['username'] = self.username br['login'] = self.username
br['code'] = self.password br['password'] = self.password
response = br.submit() response = br.submit()
raw = response.read() raw = response.read()
if '<strong>Welcome' not in raw: if '>Sign Out<' not in raw:
raise Exception('Login failed. Check your username and password') raise Exception('Login failed. Check your username and password')
return br return br