• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Easy way to parse HTTP response

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!



 
Saloon Keeper
Posts: 7582
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
reply
    Bookmark Topic Watch Topic
  • New Topic