From 2c97aeb699b73f75e4e1af0437cf2cd9102748a8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 23 Nov 2022 19:51:05 +0530 Subject: [PATCH] Add a non-working login to ft.com recipes for documentation The site uses captchas even with valid credentials. --- recipes/financial_times.recipe | 15 +++++++++++++++ recipes/financial_times_print_edition.recipe | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/recipes/financial_times.recipe b/recipes/financial_times.recipe index 15eec6dea8..f3ce5d8848 100644 --- a/recipes/financial_times.recipe +++ b/recipes/financial_times.recipe @@ -20,6 +20,21 @@ class ft(BasicNewsRecipe): masthead_url = 'https://im.ft-static.com/m/img/masthead_main.jpg' extra_css = '#fig-cap{font-style:italic; text-align:left; font-size:small;}' + # needs_subscription = 'optional' + # + # def get_browser(self, *args, **kw): + # br = super().get_browser(*args, **kw) + # if self.username and self.password: + # # ft.com uses a CAPTCHA on its login page so this sadly doesnt work + # br.open('https://accounts.ft.com/login?location=https%3A%2F%2Fwww.ft.com') + # br.select_form(id='email-form') + # br['email'] = self.username + # br.submit() + # br.select_form(id='login-form') + # br['password'] = self.password + # br.submit() + # return br + def get_cover_url(self): from datetime import date cover = 'http://img.kiosko.net/' + str( diff --git a/recipes/financial_times_print_edition.recipe b/recipes/financial_times_print_edition.recipe index ec357bb0a9..acfafbb667 100644 --- a/recipes/financial_times_print_edition.recipe +++ b/recipes/financial_times_print_edition.recipe @@ -18,6 +18,21 @@ class ft(BasicNewsRecipe): masthead_url = 'https://im.ft-static.com/m/img/masthead_main.jpg' extra_css = '#fig-cap{font-style:italic; text-align:left; font-size:small;}' + # needs_subscription = 'optional' + # + # def get_browser(self, *args, **kw): + # br = super().get_browser(*args, **kw) + # if self.username and self.password: + # # ft.com uses a CAPTCHA on its login page so this sadly doesnt work + # br.open('https://accounts.ft.com/login?location=https%3A%2F%2Fwww.ft.com') + # br.select_form(id='email-form') + # br['email'] = self.username + # br.submit() + # br.select_form(id='login-form') + # br['password'] = self.password + # br.submit() + # return br + def get_cover_url(self): from datetime import date cover = 'http://img.kiosko.net/' + str(