[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-users
Subject:    Re: DefaultHttpClient - getting contents of an iframe
From:       sebb <sebbaz () gmail ! com>
Date:       2008-02-26 9:18:11
Message-ID: 25aac9fc0802260118p27e66877u4b62acf8a85945a4 () mail ! gmail ! com
[Download RAW message or body]

On 26/02/2008, Oleg Kalnichevski <olegk@apache.org> wrote:
> 
> On Sun, 2008-02-24 at 19:00 -0400, Jeff Kerr wrote:
> > Hi there, I've had some luck following the example at:
> > http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/module-client/src/examples/org/apache/http/examples/client/ClientFormLogin.java
> >  
> > to login to a web site then get a page I'm looking for.  The problem is that
> > the page that comes back has an iframe reference who's source is what I
> > actually want.  When I try to get that page with a POST or GET it detects
> > that I'm not making the request from the iframe and redirects me to the
> > enclosing page.
> > 
> > Is there a way on my DefaultHttpClient to pretend I'm a browser making a
> > request for an iframe within a page?
> 
> 
> Hi Jeff,
> 
> One can program HttpClient to generate virtually identical HTTP
> messages. Generally you should follow a very simple approach: capture
> HTTP packets generated by browser using a traffic analyzer or a proxy,
> examine their composition, tweak HttpClient to generate similar /
> identical packets.

Some things to look out for, which the server may be relying on:

Referer and User-Agent headers
Cookies

> Hope this helps.
> 
> Oleg
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic