The Artima Developer Community
Sponsored Link

Java Answers Forum
interacting with webpages via https post

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Stephen Huey

Posts: 10
Nickname: stephen
Registered: Aug, 2003

interacting with webpages via https post Posted: Aug 8, 2003 1:57 PM
Reply to this message Reply
Advertisement
I need to schedule my Java app in a Win 2K batch file that will run periodically. Basically, the activity that I need to automate is logging into a webpage with a username and password (submitting a form), then entering some data and submitting another webpage form, and then I'll finally reach the page I want. At that point, I'll scrape the HTML off that page to find the URLs I need to download each member of the listing of large data files.

So, what I don't really know how to do is getting my Java app to pretend it's browsing the internet. I know I need to submit HTTPS POST methods with the correct parameters (for username and password, etc), but I'm not sure how to do that. I know I probably need to use the abstract class HttpsURLConnection in javax.net.ssl, and I see that its superclass has a setRequestMethod, but I don't know how to add my parameters to the POST method. I also don't know how to receive the page that it would respond with in order to parse through it (I can parse--I just don't know how to find that page that it's sending back to me).

By the way, these files and corresponding URLs are virtual and are constructed dynamically, so I can't browse the file system or anything like that--at this point, it looks like the easiest way is to scrape the page for the URLs it gives me to download them. Fun stuff...

Topic: Manipoulating user input longs Previous Topic   Next Topic Topic: can a java pgm detect the installation of apache and tomcat?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use