mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update NZZ Online
This commit is contained in:
parent
7552e35b6b
commit
a887ee24be
@ -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
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user