From ff1a31c64ccb004d57b0000c4947f34ab06a20f2 Mon Sep 17 00:00:00 2001 From: Vincent Ardisson Date: Thu, 6 Feb 2020 16:08:43 +0100 Subject: [PATCH] [materielnet] fix login which compared a string and an int The Attr()() returns a string, coerce to int. --- modules/materielnet/pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/materielnet/pages.py b/modules/materielnet/pages.py index 4ed8eeec8c..31a910734e 100644 --- a/modules/materielnet/pages.py +++ b/modules/materielnet/pages.py @@ -36,7 +36,7 @@ def get_recaptcha_sitekey(self): return Attr('//div[@class="g-recaptcha"]', 'data-sitekey', default=NotAvailable)(self.doc) def login(self, login, password, captcha_response=None): - maxlength = Attr('//input[@id="Email"]', 'data-val-maxlength-max')(self.doc) + maxlength = int(Attr('//input[@id="Email"]', 'data-val-maxlength-max')(self.doc)) regex = Attr('//input[@id="Email"]', 'data-val-regex-pattern')(self.doc) # their regex is: ^([\w\-+\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,15}|[0-9]{1,3})(\]?)$ # but it is not very good, we escape - inside [] to avoid bad character range Exception -- GitLab