Some small fixes with browser2

This commit is contained in:
Florent 2014-04-01 11:08:58 +02:00
commit 8a28d9cc5f
2 changed files with 4 additions and 5 deletions

View file

@ -127,5 +127,4 @@ class INGBackend(BaseBackend, ICapBank, ICapBill):
if not isinstance(bill, Bill):
bill = self.get_bill(bill)
self.browser.predownload(bill)
with self.browser:
return self.browser.readurl("https://secure.ingdirect.fr" + bill._url)
return self.browser.open("https://secure.ingdirect.fr" + bill._url)

View file

@ -17,7 +17,6 @@
# You should have received a copy of the GNU Affero General Public License
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
import hashlib
import urllib
from weboob.tools.browser2 import LoginBrowser, URL, need_login
from weboob.tools.browser import BrowserIncorrectPassword
@ -217,8 +216,9 @@ class IngBrowser(LoginBrowser):
############# CapBill #############
@need_login
def get_subscriptions(self):
return self.billpage.stay_or_go().iter_account()
return self.billpage.go().iter_account()
@need_login
def get_bills(self, subscription):
self.billpage.stay_or_go()
data = {"AJAXREQUEST": "_viewRoot",
@ -232,4 +232,4 @@ class IngBrowser(LoginBrowser):
return self.page.iter_bills(subid=subscription.id)
def predownload(self, bill):
self.page.postpredown(localid=bill._localid)
self.page.postpredown(bill._localid)