Update NZZ Online

This commit is contained in:
Kovid Goyal 2013-04-25 00:43:44 +05:30
parent 7552e35b6b
commit a887ee24be

View File

@ -42,7 +42,6 @@ class Nzz(BasicNewsRecipe):
soup = self.index_to_soup(baseref) soup = self.index_to_soup(baseref)
articles = {} articles = {}
key = None
ans = [] ans = []
issuelist = soup.find(id="issueSelectorList") issuelist = soup.find(id="issueSelectorList")
@ -52,7 +51,6 @@ class Nzz(BasicNewsRecipe):
section = f.string section = f.string
sectionref = baseref + f['href'] sectionref = baseref + f['href']
# print "section is "+section +" and ref is "+sectionref
ans.append(section) ans.append(section)
articlesoup = self.index_to_soup(sectionref) articlesoup = self.index_to_soup(sectionref)
@ -68,7 +66,6 @@ class Nzz(BasicNewsRecipe):
pubdate = strftime('%a, %d %b') pubdate = strftime('%a, %d %b')
if not artcaption is None: if not artcaption is None:
# print " found article named "+artcaption+" at "+arthref
if not articles.has_key(section): if not articles.has_key(section):
articles[section] = [] articles[section] = []
articles[section].append( articles[section].append(
@ -80,10 +77,10 @@ class Nzz(BasicNewsRecipe):
def get_browser(self): def get_browser(self):
br = BasicNewsRecipe.get_browser(self) br = BasicNewsRecipe.get_browser(self)
if self.username is not None and self.password is not None: if self.username is not None and self.password is not None:
br.open('https://webpaper.nzz.ch/login') br.open('https://cas.nzz.ch/cas/login')
br.select_form(nr=0) br.select_form(nr=0)
br['_username'] = self.username br['username'] = self.username
br['_password'] = self.password br['password'] = self.password
br.submit() br.submit()
return br return br