Bonjour,
Je souhaite remplir automatiquement un login et mot de passe d'une site d'emploi du temps, mais je ne sais pas comment valider le bouton ok :
Sinon pensez-vous qu'un script php serais plus simple surtout que je dois automatiser d'autres taches ensuite sur ce même site ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 public void postData() { HttpPost httppost = new HttpPost("http://caligula.ensea.fr/ade/standard/index.jsp"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(); nameValuePairs.add(new BasicNameValuePair("login", "########")); nameValuePairs.add(new BasicNameValuePair("password", "########")); try { httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } //ENVOYER REQUETE HttpClient httpclient = new DefaultHttpClient(); try { httpclient.execute(httppost); } catch (ClientProtocolException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
Merci d'avance.
Partager