fix call of ads_token convert function
This commit is contained in:
parent
27226af7d8
commit
c54dbd2ee9
1 changed files with 3 additions and 2 deletions
|
|
@ -61,10 +61,11 @@ class LoginPage(Page):
|
||||||
#paypal add this on the captcha page when the validate should be automatique
|
#paypal add this on the captcha page when the validate should be automatique
|
||||||
self.browser.controls.append(ClientForm.TextControl('text', 'ads_token_js', {'value': ''}))
|
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)
|
code = re.sub('if \(autosubmit.*', '', code)
|
||||||
js = Javascript(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)
|
self.browser.submit(nologin=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue