paypal: Try to convert from utf-8, fall back on latin-1
This commit is contained in:
parent
126b5be301
commit
49c37a5600
2 changed files with 9 additions and 1 deletions
|
|
@ -29,7 +29,7 @@ class Paypal(BaseBrowser):
|
|||
DOMAIN = 'www.paypal.com'
|
||||
PROTOCOL = 'https'
|
||||
CERTHASH = '36dc457fa47a9c0cec67ce6ac00e4a7a3846a96ed40cabbb8e1504ed8b332108'
|
||||
ENCODING = 'UTF-8' # useful for CSV
|
||||
ENCODING = 'UTF-8'
|
||||
PAGES = {
|
||||
'/cgi-bin/\?cmd=_login-run$': LoginPage,
|
||||
'/cgi-bin/\?cmd=_login-submit.+$': LoginPage, # wrong login
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import datetime
|
|||
|
||||
from weboob.tools.browser import BasePage, BrokenPageError
|
||||
from weboob.tools.parsers.csvparser import CsvParser
|
||||
from weboob.tools.misc import to_unicode
|
||||
from weboob.capabilities.bank import Account, Transaction
|
||||
from weboob.tools.capabilities.bank.transactions import FrenchTransaction
|
||||
|
||||
|
|
@ -201,5 +202,12 @@ class HistoryParser(CsvParser):
|
|||
HEADER = True
|
||||
FMTPARAMS = {'skipinitialspace': True}
|
||||
|
||||
def decode_row(self, row, encoding):
|
||||
"""
|
||||
PayPal returns different encodings (latin-1 and utf-8 are know ones)
|
||||
"""
|
||||
return [to_unicode(cell) for cell in row]
|
||||
|
||||
|
||||
class UselessPage(BasePage):
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue