URL: https://linuxfr.org/forums/programmation-python/posts/sites-securises-https Title: Sites securises https Authors: tuxelji Date: 2005年10月29日T15:10:26+02:00 Tags: Score: 0 Bonjour, je débute en python et je cherche à faire un petit soft qui automatise des taches sur le net. Pour ça je doit m'authentifier en https. j'ai fait ça: --------------------------------------------- import httplib import urllib import urllib2 # params OPPOSITION_NAME='opposition' OPPOSITION_VALUE='' LOGIN_NAME='nuabbd' LOGIN_VALUE='monLogin' PASSWORD_NAME='CodConf' PASSWORD_VALUE='monPwd' PAGE_LOGIN='/private/identification/iduniq.asp' HOSTNAME = '[https://www.net751.caisse-epargne.fr'](https://www.net751.caisse-epargne.fr') print "debut" loginPost = {OPPOSITION_NAME : OPPOSITION_VALUE, LOGIN_NAME : LOGIN_VALUE, PASSWORD_NAME : PASSWORD_VALUE} loginForm = urllib.urlencode(loginPost) # Now get that file-like object again, remembering to mention the data. loginRequest = urllib2.Request(HOSTNAME, loginForm) print "opening url" f = urllib2.urlopen(loginRequest) # Read the results back. print "got url" s = f.read() print s s.close() --------------------------------------------- mais quand je l'execute j'ai l'erreur suivante: The debugged program raised the exception unhandled HTTPError "HTTP Error 405: Method not allowed" File: /usr/lib/python2.4/urllib2.py, Line: 480 Quelqu'un sait pourquoi ? je rappel que je debute ;) D'après ce que je connais du web il faudrait rajouter un content type ou un truc comme ça non ? Quand j'aurais finit mon soft je le publierais :) c'est pour telecharger des comptes automatiquement chez caisse d'epargne !! ça devrait servir à pas mal de monde....