Ejemplo n.º 1
0
 def login(self):
     params = urlencode({
         'codeEspace': 'NO',
         'codeEFS': '01',
         'codeSi': '001',
         'noPersonne': self.config['login'].get(),
         'motDePasse': self.config['password'].get()
     })
     if 'no_check' in self.config and self.config['no_check'].get() == "y":
         conn = HellHTTPS("www.cmb.fr")
     else:
         conn = HellHTTPS("www.cmb.fr",
                          ca_file=self.AUTH_CERT,
                          callBack=self.sslCallBack)
     conn.connect()
     headers = {'Content-Type': 'application/x-www-form-urlencoded'}
     conn.request("POST", "/domiweb/servlet/Identification", params,
                  headers)
     response = conn.getresponse()
     conn.close()
     if response.status == 302:
         self.cookie = response.getheader('Set-Cookie').split(';')[0]
         self.cookie += ';'
         return True
     else:
         raise BrowserIncorrectPassword()
     return False
Ejemplo n.º 2
0
 def login(self):
     params = urlencode({
         'codeEspace': 'NO',
         'codeEFS': '01',
         'codeSi': '001',
         'noPersonne': self.config['login'].get(),
         'motDePasse': self.config['password'].get()
         })
     if 'no_check' in self.config and self.config['no_check'].get() == "y":
         conn = HellHTTPS("www.cmb.fr")
     else:
         conn = HellHTTPS("www.cmb.fr", ca_file=self.AUTH_CERT, callBack=self.sslCallBack)
     conn.connect()
     headers = {'Content-Type': 'application/x-www-form-urlencoded'}
     conn.request("POST",
                  "/domiweb/servlet/Identification",
                  params,
                  headers)
     response = conn.getresponse()
     conn.close()
     if response.status == 302:
         self.cookie = response.getheader('Set-Cookie').split(';')[0]
         self.cookie += ';'
         return True
     else:
         raise BrowserIncorrectPassword()
     return False
Ejemplo n.º 3
0
 def do_http():
     if 'no_check' in self.config and self.config['no_check'].get() == "y":
         conn = HellHTTPS("www.cmb.fr")
     else:
         conn = HellHTTPS("www.cmb.fr", ca_file=self.AUTH_CERT, callBack=self.sslCallBack)
     conn.connect()
     headers = self.headers
     headers['Cookie'] = self.cookie
     conn.request("GET", page, {}, headers)
     response = conn.getresponse()
     data = response.read()
     conn.close
     return data
Ejemplo n.º 4
0
 def do_http():
     if 'no_check' in self.config and self.config['no_check'].get() == "y":
         conn = HellHTTPS("www.cmb.fr")
     else:
         conn = HellHTTPS("www.cmb.fr", ca_file=self.AUTH_CERT, callBack=self.sslCallBack)
     conn.connect()
     headers = self.headers
     headers['Cookie'] = self.cookie
     conn.request("GET", page, {}, headers)
     response = conn.getresponse()
     data = response.read()
     conn.close
     return data