From c54dbd2ee9e57f2f9b54cc7178310bd2b1583225 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sat, 13 Jun 2015 18:21:39 +0200 Subject: [PATCH] fix call of ads_token convert function --- modules/paypal/pages.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/paypal/pages.py b/modules/paypal/pages.py index 1e4443ab..b1a4eba0 100644 --- a/modules/paypal/pages.py +++ b/modules/paypal/pages.py @@ -61,10 +61,11 @@ class LoginPage(Page): #paypal add this on the captcha page when the validate should be automatique self.browser.controls.append(ClientForm.TextControl('text', 'ads_token_js', {'value': ''})) - code = ''.join(self.document.xpath('//script[contains(text(), "convert")]/text()')) + code = ''.join(self.document.xpath('//script[contains(text(), "autosubmit")]/text()')) code = re.sub('if \(autosubmit.*', '', code) js = Javascript(code) - self.browser['ads_token_js'] = str(js.call('convert', self.browser['ads_token'])) + func_name = re.search(r'function (\w+)\(e\)', code).group(1) + self.browser['ads_token_js'] = str(js.call(func_name, self.browser['ads_token'])) self.browser.submit(nologin=True)