calibre/recipes/macrobusiness.recipe
Kovid Goyal 29cd8d64ea
Change shebangs to python from python2
Also remove a few other miscellaneous references to python2
2020-08-22 18:47:51 +05:30

29 lines
940 B
Python

#!/usr/bin/env python
# vim:fileencoding=utf-8
from __future__ import unicode_literals, division, absolute_import, print_function
from calibre.web.feeds.news import BasicNewsRecipe
class AdvancedUserRecipe(BasicNewsRecipe):
title = 'Macrobusiness'
language = 'en_AU'
__author__ = '2018robert'
oldest_article = 1
max_articles_per_feed = 100
auto_cleanup = True
needs_subscription = 'optional'
feeds = [
('Macrobusiness', 'https://www.macrobusiness.com.au/feed'),
]
def get_browser(self):
br = BasicNewsRecipe.get_browser(self)
if self.username is not None and self.password is not None:
br.open('https://www.macrobusiness.com.au/my-account/')
br.select_form(class_=lambda x: 'login' in x)
br['username'] = self.username
br['password'] = self.password
br.submit()
return br