Cleaning after browser2
This commit is contained in:
parent
8ec4f24c9a
commit
a9020483c2
2 changed files with 3 additions and 9 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
|
|
||||||
from weboob.tools.browser2 import LoginBrowser, URL, need_login
|
from weboob.tools.browser2 import LoginBrowser, URL, need_login
|
||||||
|
from weboob.tools.browser import BrowserBanned, BrowserIncorrectPassword
|
||||||
from .pages import HomePage, LoginPage, HistoryPage, BillsPage, ErrorPage
|
from .pages import HomePage, LoginPage, HistoryPage, BillsPage, ErrorPage
|
||||||
|
|
||||||
__all__ = ['PoivyBrowser']
|
__all__ = ['PoivyBrowser']
|
||||||
|
|
@ -68,5 +69,5 @@ class PoivyBrowser(LoginBrowser):
|
||||||
return self.bills.stay_or_go().get_bills()
|
return self.bills.stay_or_go().get_bills()
|
||||||
|
|
||||||
@need_login
|
@need_login
|
||||||
def get_bill(self, id):
|
def get_bill(self, _id):
|
||||||
return self._find_id_list(self.iter_bills(), _id)
|
return self._find_id_list(self.iter_bills(), _id)
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,8 @@
|
||||||
from weboob.tools.browser2.page import HTMLPage, LoggedPage, method, ListElement, ItemElement
|
from weboob.tools.browser2.page import HTMLPage, LoggedPage, method, ListElement, ItemElement
|
||||||
from weboob.tools.browser2.filters import Env, CleanText, CleanDecimal, Field, Attr, Filter, Time, Date
|
from weboob.tools.browser2.filters import Env, CleanText, CleanDecimal, Field, Attr, Filter, Time, Date
|
||||||
from weboob.capabilities.bill import Subscription, Detail
|
from weboob.capabilities.bill import Subscription, Detail
|
||||||
from decimal import Decimal, InvalidOperation
|
from datetime import datetime
|
||||||
from datetime import datetime, date, time
|
|
||||||
|
|
||||||
import re
|
|
||||||
|
|
||||||
__all__ = ['LoginPage', 'HomePage', 'HistoryPage', 'BillsPage', 'ErrorPage']
|
__all__ = ['LoginPage', 'HomePage', 'HistoryPage', 'BillsPage', 'ErrorPage']
|
||||||
|
|
||||||
|
|
@ -33,11 +31,6 @@ class ErrorPage(HTMLPage):
|
||||||
|
|
||||||
|
|
||||||
class LoginPage(HTMLPage):
|
class LoginPage(HTMLPage):
|
||||||
def _predicate_form(self, form):
|
|
||||||
try:
|
|
||||||
return form.attrs['class'] == "form-detail"
|
|
||||||
except:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def login(self, login, password):
|
def login(self, login, password):
|
||||||
captcha = self.doc.xpath('//label[@class="label_captcha_input"]')
|
captcha = self.doc.xpath('//label[@class="label_captcha_input"]')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue