Sylvyr has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way with perl to grab the URL of a specific frame?

IE: I have 2 frames. Frame1 has the perl script, frame2 is a dynamically generated form. I need to get the full URL of frame2. Is this possible?

Replies are listed 'Best First'.
Re: URLs and Frames
by inman (Curate) on Aug 25, 2005 at 19:16 UTC
    The chances are that Frame 1 has the output of a Perl script that was executed on a server. You probably want a javascript function.

    Take a look at the examples at the W3 Schools website.

Re: URLs and Frames
by CountZero (Bishop) on Aug 25, 2005 at 19:43 UTC
    Unless you can run Perl on the machine which has IE with the frames open, there is no way you can get the URL of the frames (with Perl that is; perhaps some Javascript can do it, but that was not your question).

    The Perl script runs on the web-server and its output is shown on the client (IE). How do you think the script on the server can get at the client and send some info back?

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re: URLs and Frames
by Cody Pendant (Prior) on Aug 26, 2005 at 01:22 UTC
    I'm not sure we're understanding this question correctly.

    What does the original poster mean by "IE" for a start? "Internet Explorer" or "That is..."?

    And we don't know what's mean by "I have two frames".

    If you're asking "I want to get code from a website using perl, but the code I want is in a frame whose URL changes every time", it ought to be very simple.

    Get the page containing the two frames with LWP::Simple, parse the HTML to find the URL of the second frame.

    But the whole thing's a bit of a mystery at the moment.

    Please give us more detail and an example.



    ($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
    =~y~b-v~a-z~s; print
Re: URLs and Frames
by punkish (Priest) on Aug 26, 2005 at 17:29 UTC
    - URLs belong to web pages.
    - frames are like web pages.
    - web pages run on the client's computer in the browser.
    - Perl runs on the server.
    - use JavaScript to grab the URL of one frame from another frame.
    - then send the grabbed URL back to the server in a form field.
    - feed that form field value to Perl.
    - go home happy.
    --

    when small people start casting long shadows, it is time to go to bed