diff --git a/recipes/frontlineonnet.recipe b/recipes/frontlineonnet.recipe index 73d866c3b3..ea7a680c5b 100644 --- a/recipes/frontlineonnet.recipe +++ b/recipes/frontlineonnet.recipe @@ -1,4 +1,3 @@ - __license__ = 'GPL v3' __copyright__ = '2011, Darko Miletic ' ''' @@ -36,7 +35,7 @@ class Frontlineonnet(BasicNewsRecipe): } preprocess_regexps = [ - (re.compile(r'.*?titletitle', re.DOTALL|re.IGNORECASE),lambda match: '') ,(re.compile(r'', re.DOTALL|re.IGNORECASE),lambda match: '') @@ -49,6 +48,17 @@ class Frontlineonnet(BasicNewsRecipe): ] remove_attributes=['size','noshade','border'] + use_javascript_to_login = True + needs_subscription = True + + def javascript_login(self, browser, username, password): + browser.visit('http://www.frontline.in/profile/login.do') + browser.wait_for_element('form#loginForm', timeout=180) + form = browser.select_form('#loginForm') # Select the first form on the page + form['userName'] = username + form['password'] = password + browser.submit(timeout=120) + def parse_index(self): articles = [] current_section = None