mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix error in a handful of recipes caused by upgrade to mechanize 0.3 which returns lists instead of iterators for forms() and links()
Fixes #1698646 [Failed: Fetch news from New York Times](https://bugs.launchpad.net/calibre/+bug/1698646)
This commit is contained in:
parent
e3b55941c6
commit
889fc123e1
@ -86,7 +86,7 @@ class ESPN(BasicNewsRecipe):
|
||||
f.write(raw)
|
||||
br.open_local_file(fname)
|
||||
|
||||
br.form = br.forms().next()
|
||||
br.form = list(br.forms())[0]
|
||||
br.form.find_control(
|
||||
name='username', type='text').value = self.username
|
||||
br.form['password'] = self.password
|
||||
|
@ -89,7 +89,7 @@ img { background: none !important; float: none; margin: 0px; }
|
||||
br = BasicNewsRecipe.get_browser(self)
|
||||
if self.username is not None and self.password is not None:
|
||||
br.open('https://acesso.uol.com.br/login.html')
|
||||
br.form = br.forms().next()
|
||||
br.form = list(br.forms())[0]
|
||||
br['user'] = self.username
|
||||
br['pass'] = self.password
|
||||
br.submit().read()
|
||||
|
@ -51,8 +51,8 @@ class NikkeiNet_paper_subscription(BasicNewsRecipe):
|
||||
br.open('http://www.nikkei.com/')
|
||||
print "-------------------------open first login form-----------------------------"
|
||||
try:
|
||||
url = br.links(
|
||||
url_regex="www.nikkei.com/etc/accounts/login").next().url
|
||||
url = list(br.links(
|
||||
url_regex="www.nikkei.com/etc/accounts/login"))[0].url
|
||||
except StopIteration:
|
||||
url = 'http://www.nikkei.com/etc/accounts/login?dps=3&pageflag=top&url=http%3A%2F%2Fwww.nikkei.com%2F'
|
||||
br.open(url) # br.follow_link(link)
|
||||
|
@ -417,7 +417,7 @@ class NYTimes(BasicNewsRecipe):
|
||||
br = BasicNewsRecipe.get_browser(self)
|
||||
if self.username is not None and self.password is not None:
|
||||
br.open('https://www.nytimes.com/auth/login')
|
||||
br.form = br.forms().next()
|
||||
br.form = list(br.forms())[0]
|
||||
br['userid'] = self.username
|
||||
br['password'] = self.password
|
||||
br.submit().read()
|
||||
|
Loading…
x
Reference in New Issue
Block a user