This web site creates a *popup window* => how fetch contents in a script?

Discussion in 'Python' started by seberino@spawar.navy.mil, Mar 6, 2007.

  1. Guest

    , Mar 6, 2007
    #1
    1. Advertising

  2. Re: This web site creates a *popup window* => how fetch contents in ascript?

    En Tue, 06 Mar 2007 03:18:23 -0300,
    <> escribió:

    > The following web page puts a report in a *popup window* by clicking
    > the "Generate Report" button....
    >
    > http://moneycentral.msn.com/investor/research/printrep.asp?Symbol=BBBY
    >
    > How can I grab this pop window page in a python script? (It doesn't
    > seem to have a URL!?!)


    Of course it has:
    http://moneycentral.msn.com/investor/research/sreport.asp?Symbol=BBBY&Y1=1&CR=1&Type=Equity
    If your browser don't let you know the actual URL... try a better browser
    :)

    --
    Gabriel Genellina
     
    Gabriel Genellina, Mar 6, 2007
    #2
    1. Advertising

  3. Guest

    On Mar 5, 10:38 pm, "Gabriel Genellina" <>
    wrote:
    > En Tue, 06 Mar 2007 03:18:23 -0300,
    > <> escribió:
    >
    > > The following web page puts a report in a *popup window* by clicking
    > > the "Generate Report" button....

    >
    > >http://moneycentral.msn.com/investor/research/printrep.asp?Symbol=BBBY

    >
    > > How can I grab this pop window page in a python script? (It doesn't
    > > seem to have a URL!?!)

    >
    > Of course it has:http://moneycentral.msn.com/investor/research/sreport.asp?Symbol=BBBY...
    > If your browser don't let you know the actual URL... try a better browser
    > :)
    >
    > --
    > Gabriel Genellina



    Sure I can grab the aforementioned URL's contents but what about the
    NEW contents in the NEW popup window that appears AFTER you press some
    form buttons? How grab *that* ?
     
    , Mar 6, 2007
    #3
  4. Paul Rubin Guest

    "" <> writes:
    > Sure I can grab the aforementioned URL's contents but what about the
    > NEW contents in the NEW popup window that appears AFTER you press some
    > form buttons? How grab *that* ?


    Usually it's from some fixed url with possibly some query parameters.
    Just figure out the url from your "Properties" in your browser, or by
    studying the javascript that popped up the window. There are various
    ways the popup sites can make this difficult but it's rare for them
    to bother.
     
    Paul Rubin, Mar 6, 2007
    #4
  5. Re: This web site creates a *popup window* => how fetch contents in ascript?

    En Tue, 06 Mar 2007 17:02:00 -0300,
    <> escribió:

    > On Mar 5, 10:38 pm, "Gabriel Genellina" <>
    > wrote:
    >> En Tue, 06 Mar 2007 03:18:23 -0300,
    >> <> escribió:
    >>
    >> > The following web page puts a report in a *popup window* by clicking
    >> > the "Generate Report" button....

    >>
    >> >http://moneycentral.msn.com/investor/research/printrep.asp?Symbol=BBBY

    >>
    >> > How can I grab this pop window page in a python script? (It doesn't
    >> > seem to have a URL!?!)

    >>
    >> Of course it
    >> has:http://moneycentral.msn.com/investor/research/sreport.asp?Symbol=BBBY...
    >> If your browser don't let you know the actual URL... try a better
    >> browser
    >> :)

    >
    > Sure I can grab the aforementioned URL's contents but what about the
    > NEW contents in the NEW popup window that appears AFTER you press some
    > form buttons? How grab *that* ?


    The above URL corresponds to the "NEW popup window that appears AFTER you
    press some form buttons". In particular, that is what you get if you press
    the "simple report" button (or something like that, I don't remember, and
    if even you don't care to check it, me neither).

    Anyway, I can think of 3 ways to get the info you want:
    - select some options, try some buttons, and notice the URL on the
    generated popup window. Luckily it's an HTTP GET and that URL is the only
    info you need. (Again: if your browser isn't able to show you the URL, get
    a better one!)
    - same as above, but using a protocol sniffer to record the HTTP
    requests/responses. This may be needed if HTTP POST is used instead.
    - study the HTML+javascript code.

    --
    Gabriel Genellina
     
    Gabriel Genellina, Mar 7, 2007
    #5
  6. Paul Rubin Guest

    "Gabriel Genellina" <> writes:
    > - same as above, but using a protocol sniffer to record the HTTP
    > requests/responses. This may be needed if HTTP POST is used instead.


    Usually studying the originating page is enough, or at worst use a
    client side proxy to log the http session. A protocol sniffer sounds
    like too much trouble and I've never needed to resort to one for
    something like this.
     
    Paul Rubin, Mar 7, 2007
    #6
  7. Guest

    On Mar 6, 12:27 pm, Paul Rubin <http://> wrote:
    > "" <> writes:
    > > Sure I can grab the aforementioned URL's contents but what about the
    > > NEW contents in the NEW popup window that appears AFTER you press some
    > > form buttons? How grab *that* ?

    >
    > Usually it's from some fixed url with possibly some query parameters.
    > Just figure out the url from your "Properties" in your browser, or by
    > studying the javascript that popped up the window. There are various
    > ways the popup sites can make this difficult but it's rare for them
    > to bother.



    I wanted to make sure to thank you and everyone else for the help.
    Indeed this revealed the URL.
    I just acted like I wanted to make the mystery URL my home page and it
    manifested itself.

    Thanks again all,

    Chris
     
    , Mar 9, 2007
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sck10
    Replies:
    1
    Views:
    853
    Steven Cheng[MSFT]
    Jan 16, 2006
  2. आलोक (Alok)

    A java class to fetch the contents of a web page

    आलोक (Alok), Jun 18, 2009, in forum: Java
    Replies:
    3
    Views:
    990
    Arne Vajhøj
    Jun 24, 2009
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    540
    Randy Webb
    Jun 19, 2004
  4. Raffi
    Replies:
    4
    Views:
    225
    Dr John Stockton
    Aug 12, 2004
  5. Replies:
    4
    Views:
    189
    Josef Moellers
    Oct 27, 2007
Loading...

Share This Page