Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Help:A website problem

My problem is to visit the website

http://www.billiger-telefonieren.de/tarife/tarifmodelle.php3?name=010012&verbindungsnbz=Call+by+Call&gueltigab=2006-01-27%2015:00:00&gueltigbis=0000-00-00%2000:00:00

and then there is a dropdown menu called Auslandpreise and if u click the button Hinzufgen that selected country will be added to the same webpage and after that i can extract the contents from that page.
Now the question is how to select all the elements from that menu and add it to the page from my Java program.
[538 byte] By [rajkumarger] at [2007-11-11 7:52:14]
# 1 Re: Help:A website problem
Use URLConnection (http://java.sun.com/j2se/1.5.0/docs/api/java/net/URLConnection.html). Connect to the server and download that web page. Parse out the <FORM> you are interested, and parse out <option> values for that <select>. Then recreate the form data and post it back to the server in a URLConnection, once for each option you parsed out earlier.

You'll have to look up the <post> data format (it's pretty straightforward).

If you want, you can just cut-and-paste their list of <options>, if you don't want to do the first URLConnection and parsing of the file programatically.
Laszlo at 2007-11-11 22:37:03 >