Bonjour,
J'utilise JDIC pour afficher des pages web dans mon applications.
Je voudrais pouvoir récupérer certaines informations de mes pages web.
Lorsque j'affiche le code source de ma page avec Firefox, je trouve bien les informations que je cherche. Mais lorsque je passe par mon application JAVA avec JDIC, ce ne sont plus les mêmes données !!!
Quelqu'un peut-il m'aider ?
Pour information, je donne ci-dessous :
1 - les quelques instructions que j'utilise pour récupérer mes données.
2 - le début du code HTML/PHP que je récupère par Firefox.
2 - le début du code HTML/PHP que je récupère par JDIC.
Extrait de Code :
Extrait code source page Firefox :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 urlConnectionContacts = urlContacts.openConnection(); bufferedReaderContacts = new BufferedReader(new InputStreamReader(urlConnectionContacts.getInputStream())); while ((lineHtmlMessage = bufferedReaderContacts.readLine()) != null) { System.out.println(lineHtmlMessage); if (lineHtmlMessage.indexOf("msgBody>", 8) >-1) { System.out.println("ICI : " + lineHtmlMessage); } } bufferedReaderContacts.close();
Extrait code source par JDIC :
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 <html> <head> <title>InterPals Penpals :: My Home</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="charset" content="utf-8" /> <link rel='shortcut icon' href='http://slde.ipstatic.net/images/icons/env-blu-16.png' type='image/png' /><base href="http://www.interpals.net/" /> <link rel='stylesheet' type='text/css' href='http://css.slde.ipstatic.net/css/9/uni/interpals.css' /><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script></head><body><center><div id=topBar> <div id=topBarChild><div id=chatStatus> <strong>Chat availability:</strong> <select class='selSave' disabled cb='/update_chat.php'><option value='1' selected>InterPals Members</option><option value='2'>My Friends</option><option value='3'>No one</option></select></div><div id=topBarLinks><a href="/invite.php">Invite Friends</a> | <a href="/feedback.php">Feedback</a> | <a href="/tips.php">Tips</a> | <a href="/faq.php">Help</a> </div> <div id=addThis> <!-- AddThis Bookmark Button BEGIN --> <script type="text/javascript">
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
27 <html> <head> <title>InterPals Penpals :: Log in</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="charset" content="utf-8" /> <link rel='shortcut icon' href='http://slde.ipstatic.net/images/icons/env-blu-16.png' type='image/png' /><base href="http://www.interpals.net/" /> <link rel='stylesheet' type='text/css' href='http://css.slde.ipstatic.net/css/9/uni/interpals.css' /><meta name="googlebot" content="noindex,nofollow"></head><body><center><div id=topBar style="height: 28px;"> <div id=topLogin> <form action='/login.php' id='topLoginF' method=post style='display: none;'> <input type=hidden name=action value=login> <input type=text name=login value='Username or Email'> <span id=topLogPw> <input type=text name=password value='Password' id=topLoginPw></span> <input type=checkbox name=auto_login id=auto_login value=1 checked> <label for=auto_login>Remember me</label> <input type=submit value='Sign In'> </form> </div></div><div id=logoAdBar><div class="topLogo"> <a href='http://www.interpals.net'> <img src='http://slde.ipstatic.net/images/logopenpals.png' width='175' height='63'style="margin-top: 17px;"></a></div><div class=topLB><iframe id='6120864' name='6120864' src='http://ads.eu.interpals.net/ad_static/1/ros_atf_lb.html' framespacing='0' frameborder='no' scrolling='no' width='728' height='90'> </iframe> </div> </div> <div id=mc_box style="clear: both;border-top: 1px;">
Partager