I am building a java program that requires reading a specific web page. What makes it hard is that the
page I want to read is being redirected to by another page. The following list describes the issue:
1- Give the program a link that will do some actions and then redirect to another link
2- Read the new link and its content.
Issues:1- The original link's response code is 200 not 301
2- The link that is being directed to is a one session link and cannot be re-accessed
Example: Assume that there is a link that opens to a page that tries to look up
a flight between two cities. This page shows a loading image and as soon as it
collects the results, it directs you to them in a new page that is one session page which
what I need to read.
What I did:
I tried to use HTTPClient but I couldn't really understand how it works. What I need to do is very simple,
Enter a link that will look for all available flights. This page is a loading page that generates a one session link. I need to be able to read that one session link (read the source file). I know how to read the source file, but I don't know how to access it since I cannot grab that page. I used java.net.URLConnection and java.net.HttpURLConnection to open a connection with the link or the page where looking for flights is happening, but I couldn't figure out how to get to the next page where flights are being displayed since the response code is 200 which means succession. If the response code was 301, my life would be much easier.
I'm looking forward to hearing any suggestions...