Macrobusinness by 2018robert

This commit is contained in:
Kovid Goyal 2018-12-06 10:49:32 +05:30
parent d00558765d
commit 320487b8df
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -0,0 +1,28 @@
#!/usr/bin/env python2
# 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