title: Android/Java: Simulate a click on this webpage
body: <p>Last year I made an Android application that scrapped the informations on my train company in Belgium ( application is BETrains: <a href="http://www.cyrket.com/p/android/tof.cv.mpp/" rel="nofollow noreferrer">http://www.cyrket.com/p/android/tof.cv.mpp/</a>)</p>
  
  <p>This application was really cool and allowed users to talk with other people in the train ( a messagery server is runned by me) and the conversations wre also on Twitter: <a href="http://twitter.com/betrains" rel="nofollow noreferrer">http://twitter.com/betrains</a></p>
  
  <p>Everybody in Belgium loved it. The company tried to avoid us to use their data, make some users websites closed, but their was some lawyers that attack the company and finally we have no more problems and the websites are open: <a href="http://blog.tuinslak.org/2010/07/irail-is-back" rel="nofollow noreferrer">http://blog.tuinslak.org/2010/07/irail-is-back</a></p>
  
  <p>So, legally my application is ( for now) totally correct and legal, but I get no help from the train company.</p>
  
  <p>So my question is a little help to get the datas. I am now an android/java beginner and spend some weeks to try to find a solution, but maybe people like will fint it in a few minuts.</p>
  
  <p>So the problem is the next one. You may have a look at the following URL, and you will find 2 cities names within URL: Mons and Tournai, and also informations on the date and time. That was the old method that worked one year:</p>
  
  <p><a href="http://hari.b-holding.be/Hafas/bin/query.exe/en?&amp;REQ0JourneyStopsS0A=1&amp;REQ0JourneyStopsS0G=MONS%20[b]&amp;REQ0JourneyStopsZ0A=1&amp;REQ0JourneyStopsZ0G=TOURNAI%20[b]&amp;REQ0JourneyDate=27.010.10&amp;REQ0JourneyTime=19:030&amp;Timesel=depart&amp;ViaName=&amp;ViaMode=NEE&amp;DateMode=ANDERS&amp;PLANNER=TRUE&amp;start=1&amp;queryPageDisplayed=yes" rel="nofollow noreferrer">http://hari.b-holding.be/Hafas/bin/query.exe/en?&amp;REQ0JourneyStopsS0A=1&amp;REQ0JourneyStopsS0G=MONS%20[b]&amp;REQ0JourneyStopsZ0A=1&amp;REQ0JourneyStopsZ0G=TOURNAI%20[b]&amp;REQ0JourneyDate=27.010.10&amp;REQ0JourneyTime=19:030&amp;Timesel=depart&amp;ViaName=&amp;ViaMode=NEE&amp;DateMode=ANDERS&amp;PLANNER=TRUE&amp;start=1&amp;queryPageDisplayed=yes</a></p>
  
  <p>But now, the URL bring me on a confirmation page and I have to click on the confirm button to get to the next page.</p>
  
  <p>So my code won't work anymore, I need to click on this button programmatically to arrive on the correct webpage.</p>
  
  <p>Have you any idea on how to simulate a click on this button? For now my code is the classic scrapping code with the URL given a few line on the top. I assumed that the Url give me the result page. That was the case till last week.</p>
  
  <pre><code>DefaultHttpClient httpclient = new DefaultHttpClient();
          HttpGet get = new HttpGet(mon_url);
          HttpResponse response;
              try {
                    response = httpclient.execute(get);
                    HttpEntity entity = response.getEntity();        
                    BufferedReader buf = new BufferedReader(new InputStreamReader(entity.getContent()));
                   etc...
  </code></pre>
  
  <p>Have you any idea on how to improve the code?</p>
  
  <p>As the software is free, I cannot send paypal money, but a whole country would be really thankfull to the man that might help!</p>
  
  <p>Thank a lot.</p>