This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HttpClient login, search and get the HTML content  RSS feed

 
Danny Sater
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to login to a site using HttpClient and after logging in I want to search in the HTML content and retrieve the contents of the search result.



when I print the output from HttpEntity it's printing the login page contents. How do I get the contents of the page after I login using HttpClient?
I tried couple of other sites and it worked for me, but not for mint.com please help
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could use an HTTP monitor to see how the request differs between logging in via the web site, and logging in via HttpClient.

If this was my problem I'd use HtmlUnit instead of HttpClient, as it has a higher-level API for dealing with programmatic web access.
 
Danny Sater
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:You could use an HTTP monitor to see how the request differs between logging in via the web site, and logging in via HttpClient.

If this was my problem I'd use HtmlUnit instead of HttpClient, as it has a higher-level API for dealing with programmatic web access.


Thank you for this information... I'm still wondering why my code work for some sites and not for others ... Thanks in advance.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It all depends on the SSL security mechanism being used.

This is a fragment I wrote:


That may help or point you in the correct direction.

WP
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!