title: how to use java.net.URLConnection to obtain a captcha image in a php web form
body: <p>I am trying to automate submission of same/similar data to web forms. AS part of this process, I want to submit data to a PHP web form that has a captcha... The captcha is defined as Img src="http://domain.com/captcha.php".... it is linked to a text field on the page named "CAPTCHA"</p>
  
  <p>The page to which I want to submit data is at <a href="http://domain.com/submit.php" rel="nofollow">http://domain.com/submit.php</a>.. I am trying to use java.net.URLConnection to open a connection to this page.</p>
  
  <p>What I want to know is, how do I obtain the value of this captcha image on screen? I want the end user to fill in this captcha, and then I will submit the form to its action, along with the captcha (I already have values for all other fields).</p>
  
  <p>In the Sun Documentation on Java.net.urlconnection I found the following relevant section- </p>
  
  <p>"The following methods are used to access the header fields and the contents after the connection is made to the remote object: </p>
  
  <ul>
  <li>getContent </li>
  <li>getHeaderField </li>
  <li>getInputStream </li>
  <li>getOutputStream"</li>
  </ul>
  
  <p>I cant find a good example for "getContent" which I feel should be the function to retrieve data from the web page. I plan to use URLConnection on Google App Engine for Java.</p>
  
  <p>Any help would be appreciated.</p>