Fix changed form name on FT login page

This commit is contained in:
Kovid Goyal 2017-02-22 07:43:08 +05:30
parent 664da9368c
commit c81ac9e9b9
3 changed files with 19 additions and 18 deletions

View File

@ -31,22 +31,23 @@ class FinancialTimes_rss(BasicNewsRecipe):
remove_empty_feeds = True
publication_type = 'newspaper'
masthead_url = 'http://im.media.ft.com/m/img/masthead_main.jpg'
LOGIN = 'https://accounts.ft.com/login'
INDEX = 'http://www.ft.com'
handle_gzip = True
LOGIN = 'https://www.ft.com/login?location=/'
INDEX = 'https://www.ft.com'
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
br.open(self.INDEX)
if self.username is not None and self.password is not None:
br.open(self.LOGIN)
br.select_form(name='login')
br.select_form(name='enter-email-form')
br['email'] = self.username
br['password'] = self.password
br.submit()
return br
keep_only_tags = [
classes('article__header--wrapper article__time-byline article__body n-content-image')
classes('article__header--wrapper article__time-byline article__body n-content-image barrier-grid__heading')
]
remove_tags = [
@ -56,10 +57,10 @@ class FinancialTimes_rss(BasicNewsRecipe):
remove_attributes = ['width', 'height', 'lang', 'style']
feeds = [
(u'UK', u'http://www.ft.com/rss/home/uk'),
(u'US', u'http://www.ft.com/rss/home/us'),
(u'Asia', u'http://www.ft.com/rss/home/asia'),
(u'Middle East', u'http://www.ft.com/rss/home/middleeast')
(u'UK', u'https://www.ft.com/rss/home/uk'),
(u'US', u'https://www.ft.com/rss/home/us'),
(u'Asia', u'https://www.ft.com/rss/home/asia'),
(u'Middle East', u'https://www.ft.com/rss/home/middleeast')
]
def preprocess_html(self, soup):

View File

@ -29,12 +29,12 @@ class FinancialTimes(BasicNewsRecipe):
needs_subscription = True
encoding = 'utf8'
publication_type = 'newspaper'
LOGIN = 'https://accounts.ft.com/login?location=http%3A%2F%2Fwww.ft.com%2Fhome%2Fuk'
INDEX = 'http://www.ft.com/uk-edition'
PREFIX = 'http://www.ft.com'
handle_gzip = True
LOGIN = 'https://accounts.ft.com/login?location=https%3A%2F%2Fwww.ft.com%2Fhome%2Fuk'
INDEX = 'https://www.ft.com/uk-edition'
keep_only_tags = [
classes('article__header--wrapper article__time-byline article__body n-content-image')
classes('article__header--wrapper article__time-byline article__body n-content-image barrier-grid__heading')
]
remove_tags = [
@ -48,7 +48,7 @@ class FinancialTimes(BasicNewsRecipe):
br.open(self.INDEX)
if self.username is not None and self.password is not None:
br.open(self.LOGIN)
br.select_form(name='login')
br.select_form(name='enter-email-form')
br['email'] = self.username
br['password'] = self.password
br.submit()

View File

@ -29,12 +29,12 @@ class FinancialTimes(BasicNewsRecipe):
needs_subscription = True
encoding = 'utf8'
publication_type = 'newspaper'
LOGIN = 'https://accounts.ft.com/login?location=http%3A%2F%2Fwww.ft.com%2Fhome%2Fuk'
INDEX = 'http://www.ft.com/international-edition'
PREFIX = 'http://www.ft.com'
handle_gzip = True
LOGIN = 'https://accounts.ft.com/login?location=https%3A%2F%2Fwww.ft.com%2Fhome%2Fuk'
INDEX = 'https://www.ft.com/international-edition'
keep_only_tags = [
classes('article__header--wrapper article__time-byline article__body n-content-image')
classes('article__header--wrapper article__time-byline article__body n-content-image barrier-grid__heading')
]
remove_tags = [
@ -48,7 +48,7 @@ class FinancialTimes(BasicNewsRecipe):
br.open(self.INDEX)
if self.username is not None and self.password is not None:
br.open(self.LOGIN)
br.select_form(name='login')
br.select_form(name='enter-email-form')
br['email'] = self.username
br['password'] = self.password
br.submit()