Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Easy way to parse HTTP response

 
Matthew Busse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Java Geniuses,

I'm using HTTPClient to access a website using a POST request. Does HTTPClient provide any tools for easily parsing the response? The "tutorials" on the Apache website were not much help, I had to search several other sites just the get the POST request working.

For example, I'm getting back a table like this:


Is there an easy way to convert that into an excel file or XML document or something?

Thanks!



 
Tim Moores
Bartender
Posts: 2947
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like the HtmlUnit (or jWebUnit) library for interacting programmatically with a web site. It has various methods for accessing and extracting specific bits of an HTML page's content.
 
Matthew Busse
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:I like the HtmlUnit (or jWebUnit) library for interacting programmatically with a web site. It has various methods for accessing and extracting specific bits of an HTML page's content.


Great, HtmlUnit looks like it has a lot of potential.

My only hesitation is that the form request methods in HtmlUnit seem rather clunky, you have to look at the source page to get the form name and the name of the submit button, etc.

Am I correct in thinking HtmlUnit is built on HttpClient? Is it possible to use the post request methods from HttpClient and feed that response into HtmlUnit?

Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic