mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update Frontline
This commit is contained in:
parent
6c77678f57
commit
d368f0f745
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
|
__copyright__ = '2011, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
'''
|
'''
|
||||||
@ -36,7 +35,7 @@ class Frontlineonnet(BasicNewsRecipe):
|
|||||||
}
|
}
|
||||||
|
|
||||||
preprocess_regexps = [
|
preprocess_regexps = [
|
||||||
(re.compile(r'.*?<base', re.DOTALL|re.IGNORECASE),lambda match: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html dir="ltr" xml:lang="en-IN"><head><title>title</title><base')
|
(re.compile(r'.*?<base', re.DOTALL|re.IGNORECASE),lambda match: '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html dir="ltr" xml:lang="en-IN"><head><title>title</title><base') # noqa
|
||||||
,(re.compile(r'<base .*?>', re.DOTALL|re.IGNORECASE),lambda match: '</head><body>')
|
,(re.compile(r'<base .*?>', re.DOTALL|re.IGNORECASE),lambda match: '</head><body>')
|
||||||
,(re.compile(r'<byline>', re.DOTALL|re.IGNORECASE),lambda match: '<div class="byline">')
|
,(re.compile(r'<byline>', re.DOTALL|re.IGNORECASE),lambda match: '<div class="byline">')
|
||||||
,(re.compile(r'</byline>', re.DOTALL|re.IGNORECASE),lambda match: '</div>')
|
,(re.compile(r'</byline>', re.DOTALL|re.IGNORECASE),lambda match: '</div>')
|
||||||
@ -49,6 +48,17 @@ class Frontlineonnet(BasicNewsRecipe):
|
|||||||
]
|
]
|
||||||
remove_attributes=['size','noshade','border']
|
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):
|
def parse_index(self):
|
||||||
articles = []
|
articles = []
|
||||||
current_section = None
|
current_section = None
|
||||||
|
Loading…
x
Reference in New Issue
Block a user